eval(function (e, a, c, m, k, l) {
    k = function (b) {
        return(b < a ? "" : k(parseInt(b / a))) + ((b = b % a) > 35 ? String.fromCharCode(b + 29) : b.toString(36))
    };
    if (!"".replace(/^/, String)) {
        while (c--) {
            l[k(c)] = m[c] || k(c)
        }
        m = [function (b) {
            return l[b]
        }];
        k = function () {
            return"\\w+"
        };
        c = 1
    }
    while (c--) {
        if (m[c]) {
            e = e.replace(new RegExp("\\b" + k(c) + "\\b", "g"), m[c])
        }
    }
    return e
}("(4($){$.R($.7,{3:4(c,b,d){9 e=2,q;5($.O(c))d=b,b=c,c=z;$.h($.3.j,4(i,a){5(e.8==a.8&&e.g==a.g&&c==a.m&&(!b||b.$6==a.7.$6)&&(!d||d.$6==a.o.$6))l(q=a)&&v});q=q||Y $.3(2.8,2.g,c,b,d);q.u=v;$.3.s(q.F);l 2},T:4(c,b,d){9 e=2;5($.O(c))d=b,b=c,c=z;$.h($.3.j,4(i,a){5(e.8==a.8&&e.g==a.g&&(!c||c==a.m)&&(!b||b.$6==a.7.$6)&&(!d||d.$6==a.o.$6)&&!2.u)$.3.y(a.F)});l 2}});$.3=4(e,c,a,b,d){2.8=e;2.g=c||S;2.m=a;2.7=b;2.o=d;2.t=[];2.u=v;2.F=$.3.j.K(2)-1;b.$6=b.$6||$.3.I++;5(d)d.$6=d.$6||$.3.I++;l 2};$.3.p={y:4(){9 b=2;5(2.m)2.t.16(2.m,2.7);E 5(2.o)2.t.h(4(i,a){b.o.x(a)});2.t=[];2.u=Q},s:4(){5(2.u)l;9 b=2;9 c=2.t,w=$(2.8,2.g),H=w.11(c);2.t=w;5(2.m){H.10(2.m,2.7);5(c.C>0)$.h(c,4(i,a){5($.B(a,w)<0)$.Z.P(a,b.m,b.7)})}E{H.h(4(){b.7.x(2)});5(2.o&&c.C>0)$.h(c,4(i,a){5($.B(a,w)<0)b.o.x(a)})}}};$.R($.3,{I:0,j:[],k:[],A:v,D:X,N:4(){5($.3.A&&$.3.k.C){9 a=$.3.k.C;W(a--)$.3.j[$.3.k.V()].s()}},U:4(){$.3.A=v},M:4(){$.3.A=Q;$.3.s()},L:4(){$.h(G,4(i,n){5(!$.7[n])l;9 a=$.7[n];$.7[n]=4(){9 r=a.x(2,G);$.3.s();l r}})},s:4(b){5(b!=z){5($.B(b,$.3.k)<0)$.3.k.K(b)}E $.h($.3.j,4(a){5($.B(a,$.3.k)<0)$.3.k.K(a)});5($.3.D)1j($.3.D);$.3.D=1i($.3.N,1h)},y:4(b){5(b!=z)$.3.j[b].y();E $.h($.3.j,4(a){$.3.j[a].y()})}});$.3.L('1g','1f','1e','1b','1a','19','18','17','1c','15','1d','P');$(4(){$.3.M()});9 f=$.p.J;$.p.J=4(a,c){9 r=f.x(2,G);5(a&&a.8)r.g=a.g,r.8=a.8;5(14 a=='13')r.g=c||S,r.8=a;l r};$.p.J.p=$.p})(12);", 62, 82, "||this|livequery|function|if|lqguid|fn|selector|var|||||||context|each||queries|queue|return|type||fn2|prototype|||run|elements|stopped|false|els|apply|stop|undefined|running|inArray|length|timeout|else|id|arguments|nEls|guid|init|push|registerPlugin|play|checkQueue|isFunction|remove|true|extend|document|expire|pause|shift|while|null|new|event|bind|not|jQuery|string|typeof|toggleClass|unbind|addClass|removeAttr|attr|wrap|before|removeClass|empty|after|prepend|append|20|setTimeout|clearTimeout".split("|"), 0, {}));
new function (m) {
    var n = m.separator || "&";
    var o = m.spaces === false ? false : true;
    var j = m.suffix === false ? "" : "[]";
    var k = m.prefix === false ? false : true;
    var h = k ? m.hash === true ? "#" : "?" : "";
    var l = m.numbers === false ? false : true;
    jQuery.query = new function () {
        var d = function (f, e) {
            return f != undefined && f !== null && (!!e ? f.constructor == e : true)
        };
        var c = function (e) {
            var v, f = /\[([^[]*)\]/g, u = /^(\S+?)(\[\S*\])?$/.exec(e), t = u[1], g = [];
            while (v = f.exec(u[2])) {
                g.push(v[1])
            }
            return[t, g]
        };
        var a = function (g, v, w) {
            var f, x = v.shift();
            if (typeof g != "object") {
                g = null
            }
            if (x === "") {
                if (!g) {
                    g = []
                }
                if (d(g, Array)) {
                    g.push(v.length == 0 ? w : a(null, v.slice(0), w))
                } else {
                    if (d(g, Object)) {
                        var y = 0;
                        while (g[y++] != null) {
                        }
                        g[--y] = v.length == 0 ? w : a(g[y], v.slice(0), w)
                    } else {
                        g = [];
                        g.push(v.length == 0 ? w : a(null, v.slice(0), w))
                    }
                }
            } else {
                if (x && x.match(/^\s*[0-9]+\s*$/)) {
                    var z = parseInt(x, 10);
                    if (!g) {
                        g = []
                    }
                    g[z] = v.length == 0 ? w : a(g[z], v.slice(0), w)
                } else {
                    if (x) {
                        var z = x.replace(/^\s*|\s*$/g, "");
                        if (!g) {
                            g = {}
                        }
                        if (d(g, Array)) {
                            var e = {};
                            for (var y = 0; y < g.length; ++y) {
                                e[y] = g[y]
                            }
                            g = e
                        }
                        g[z] = v.length == 0 ? w : a(g[z], v.slice(0), w)
                    } else {
                        return w
                    }
                }
            }
            return g
        };
        var b = function (e) {
            var f = this;
            f.keys = {};
            if (e.queryObject) {
                jQuery.each(e.get(), function (q, g) {
                    f.SET(q, g)
                })
            } else {
                jQuery.each(arguments, function () {
                    var g = "" + this;
                    g = g.replace(/^[?#]/, "");
                    g = g.replace(/[;&]$/, "");
                    if (o) {
                        g = g.replace(/[+]/g, " ")
                    }
                    jQuery.each(g.split(/[&;]/), function () {
                        var s = decodeURIComponent(this.split("=")[0]);
                        var r = decodeURIComponent(encodeURIComponent(this.split("=")[1]));
                        if (!s) {
                            return
                        }
                        if (l) {
                            if (/^[+-]?[0-9]+\.[0-9]*$/.test(r)) {
                                r = parseFloat(r)
                            } else {
                                if (/^[+-]?[0-9]+$/.test(r)) {
                                    r = parseInt(r, 10)
                                }
                            }
                        }
                        r = (!r && r !== 0) ? true : r;
                        if (r !== false && r !== true && typeof r != "number") {
                            r = r
                        }
                        f.SET(s, r)
                    })
                })
            }
            return f
        };
        b.prototype = {queryObject:true, has:function (e, g) {
            var f = this.get(e);
            return d(f, g)
        }, GET:function (s) {
            if (!d(s)) {
                return this.keys
            }
            var e = c(s), r = e[0], f = e[1];
            var g = this.keys[r];
            while (g != null && f.length != 0) {
                g = g[f.shift()]
            }
            return typeof g == "number" ? g : g || ""
        }, get:function (e) {
            var f = this.GET(e);
            if (d(f, Object)) {
                return jQuery.extend(true, {}, f)
            } else {
                if (d(f, Array)) {
                    return f.slice(0)
                }
            }
            return f
        }, SET:function (w, f) {
            var u = !d(f) ? null : f;
            var e = c(w), v = e[0], g = e[1];
            var t = this.keys[v];
            this.keys[v] = a(t, g.slice(0), u);
            return this
        }, set:function (e, f) {
            return this.copy().SET(e, f)
        }, REMOVE:function (e) {
            return this.SET(e, null).COMPACT()
        }, remove:function (e) {
            return this.copy().REMOVE(e)
        }, EMPTY:function () {
            var e = this;
            jQuery.each(e.keys, function (g, f) {
                delete e.keys[g]
            });
            return e
        }, load:function (e) {
            var f = e.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1");
            var g = e.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1");
            return new b(e.length == g.length ? "" : g, e.length == f.length ? "" : f)
        }, empty:function () {
            return this.copy().EMPTY()
        }, copy:function () {
            return new b(this)
        }, COMPACT:function () {
            function e(f) {
                var g = typeof f == "object" ? d(f, Array) ? [] : {} : f;
                if (typeof f == "object") {
                    function q(p, u, t) {
                        if (d(p, Array)) {
                            p.push(t)
                        } else {
                            p[u] = t
                        }
                    }

                    jQuery.each(f, function (s, p) {
                        if (!d(p)) {
                            return true
                        }
                        q(g, s, e(p))
                    })
                }
                return g
            }

            this.keys = e(this.keys);
            return this
        }, compact:function () {
            return this.copy().COMPACT()
        }, toString:function () {
            var t = 0, f = [], g = [], u = this;
            var e = function (w, r, q) {
                if (!d(q) || q === false) {
                    return
                }
                var p = [encodeURIComponent(r)];
                if (q !== true) {
                    p.push("=");
                    p.push(encodeURIComponent(q))
                }
                w.push(p.join(""))
            };
            var s = function (q, r) {
                var p = function (w) {
                    return !r || r == "" ? [w].join("") : [r, "[", w, "]"].join("")
                };
                jQuery.each(q, function (y, x) {
                    if (typeof x == "object") {
                        s(x, p(y))
                    } else {
                        e(g, p(y), x)
                    }
                })
            };
            s(this.keys);
            if (g.length > 0) {
                f.push(h)
            }
            f.push(g.join(n));
            return f.join("")
        }};
        return new b(location.search, location.hash)
    }
}(jQuery.query || {});
eval(function (e, a, c, m, k, l) {
    k = function (b) {
        return(b < a ? "" : k(parseInt(b / a))) + ((b = b % a) > 35 ? String.fromCharCode(b + 29) : b.toString(36))
    };
    if (!"".replace(/^/, String)) {
        while (c--) {
            l[k(c)] = m[c] || k(c)
        }
        m = [function (b) {
            return l[b]
        }];
        k = function () {
            return"\\w+"
        };
        c = 1
    }
    while (c--) {
        if (m[c]) {
            e = e.replace(new RegExp("\\b" + k(c) + "\\b", "g"), m[c])
        }
    }
    return e
}("n.5=v(a,b,c){4(7 b!='w'){c=c||{};4(b===o){b='';c.3=-1}2 d='';4(c.3&&(7 c.3=='p'||c.3.q)){2 e;4(7 c.3=='p'){e=x y();e.z(e.A()+(c.3*B*r*r*C))}s{e=c.3}d=';3='+e.q()}2 f=c.8?';8='+(c.8):'';2 g=c.9?';9='+(c.9):'';2 h=c.t?';t':'';6.5=[a,'=',D(b),d,f,g,h].E('')}s{2 j=o;4(6.5&&6.5!=''){2 k=6.5.F(';');G(2 i=0;i<k.m;i++){2 l=n.H(k[i]);4(l.u(0,a.m+1)==(a+'=')){j=I(l.u(a.m+1));J}}}K j}};", 47, 47, "||var|expires|if|cookie|document|typeof|path|domain|||||||||||||length|jQuery|null|number|toUTCString|60|else|secure|substring|function|undefined|new|Date|setTime|getTime|24|1000|encodeURIComponent|join|split|for|trim|decodeURIComponent|break|return".split("|"), 0, {}));
Function.prototype.overwrite = function (c) {
    var d = c;
    if (!d.original) {
        d.original = this
    }
    return d
};
Date.prototype.toString = Date.prototype.toString.overwrite(function (c) {
    var d = new String();
    if (typeof(c) == "string") {
        d = c;
        d = d.replace(/yyyy|YYYY/, this.getFullYear());
        d = d.replace(/yy|YY/, this.getFullYear().toString().substr(2, 2));
        d = d.replace(/MM/, this.getMonth() >= 9 ? this.getMonth() + 1 : "0" + (this.getMonth() + 1));
        d = d.replace(/M/, this.getMonth());
        d = d.replace(/dd|DD/, this.getDate() > 9 ? this.getDate() : "0" + this.getDate());
        d = d.replace(/d|D/, this.getDate());
        d = d.replace(/hh|HH/, this.getHours() > 9 ? this.getHours() : "0" + this.getHours());
        d = d.replace(/h|H/, this.getHours());
        d = d.replace(/mm/, this.getMinutes() > 9 ? this.getMinutes() : "0" + this.getMinutes());
        d = d.replace(/m/, this.getMinutes());
        d = d.replace(/ss|SS/, this.getSeconds() > 9 ? this.getSeconds() : "0" + this.getSeconds());
        d = d.replace(/s|S/, this.getSeconds())
    }
    return d
});
String.prototype.format = function () {
    var b = this;
    if (arguments.length > 0) {
        parameters = $.makeArray(arguments);
        $.each(parameters, function (a, d) {
            b = b.replace(new RegExp("\\{" + a + "\\}", "g"), d)
        })
    }
    return b
};
function StringBuilder() {
    this.strings = new Array();
    this.length = 0
}
StringBuilder.prototype.append = function (b) {
    this.strings.push(b);
    this.length += b.length
};
StringBuilder.prototype.toString = function (c, d) {
    return this.strings.join("").substr(c, d)
};
(function ($) {
    $.jmsajax = function (options) {
        var defaults = {type:"POST", dataType:"msjson", data:{}, beforeSend:function (xhr) {
            xhr.setRequestHeader("Content-type", "application/json; charset=utf-8")
        }, contentType:"application/json; charset=utf-8", error:function (x, s, m) {
            alert("Status: " + ((x.statusText) ? x.statusText : "Unknown") + "\nMessage: " + msJSON.parse(((x.responseText) ? x.responseText : "Unknown")).Message)
        }};
        var options = $.extend(defaults, options);
        if (options.method) {
            options.url += "/" + options.method
        }
        if (options.data) {
            if (options.type == "GET") {
                var data = "";
                for (var i in options.data) {
                    if (data != "") {
                        data += "&"
                    }
                    data += i + "=" + msJSON.stringify(options.data[i])
                }
                options.url += "?" + data;
                data = null;
                options.data = "{}"
            } else {
                if (options.type == "POST") {
                    options.data = msJSON.stringify(options.data)
                }
            }
        }
        if (options.success) {
            if (options.dataType) {
                if (options.dataType == "msjson") {
                    var base = options.success;
                    options.success = function (response, status) {
                        var y = dateparse(response);
                        if (options.version) {
                            if (options.version >= 3.5) {
                                y = y.d
                            }
                        } else {
                            if (response.indexOf('{"d":') == 0) {
                                y = y.d
                            }
                        }
                        base(y, status)
                    }
                }
            }
        }
        return $.ajax(options)
    };
    dateparse = function (data) {
        try {
            return msJSON.parse(data, function (key, value) {
                var a;
                if (typeof value === "string") {
                    if (value.indexOf("Date") >= 0) {
                        a = /^\/Date\(([0-9]+)\)\/$/.exec(value);
                        if (a) {
                            return new Date(parseInt(a[1], 10))
                        }
                    }
                }
                return value
            })
        } catch (e) {
            return null
        }
    };
    msJSON = function () {
        function f(n) {
            return n < 10 ? "0" + n : n
        }

        var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapeable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {"\b":"\\b", "\t":"\\t", "\n":"\\n", "\f":"\\f", "\r":"\\r", '"':'\\"', "\\":"\\\\"}, rep;

        function quote(string) {
            escapeable.lastIndex = 0;
            return escapeable.test(string) ? '"' + string.replace(escapeable, function (a) {
                var c = meta[a];
                if (typeof c === "string") {
                    return c
                }
                return"\\u" + ("0000" + (+(a.charCodeAt(0))).toString(16)).slice(-4)
            }) + '"' : '"' + string + '"'
        }

        function str(key, holder) {
            var i, k, v, length, mind = gap, partial, value = holder[key];
            if (value && typeof value === "object" && typeof value.toJSON === "function") {
                value = value.toJSON(key)
            }
            if (typeof rep === "function") {
                value = rep.call(holder, key, value)
            }
            switch (typeof value) {
                case"string":
                    return quote(value);
                case"number":
                    return isFinite(value) ? String(value) : "null";
                case"boolean":
                case"null":
                    return String(value);
                case"object":
                    if (!value) {
                        return"null"
                    }
                    if (value.toUTCString) {
                        return'"\\/Date(' + (value.getTime()) + ')\\/"'
                    }
                    gap += indent;
                    partial = [];
                    if (typeof value.length === "number" && !(value.propertyIsEnumerable("length"))) {
                        length = value.length;
                        for (i = 0; i < length; i += 1) {
                            partial[i] = str(i, value) || "null"
                        }
                        v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]";
                        gap = mind;
                        return v
                    }
                    if (rep && typeof rep === "object") {
                        length = rep.length;
                        for (i = 0; i < length; i += 1) {
                            k = rep[i];
                            if (typeof k === "string") {
                                v = str(k, value, rep);
                                if (v) {
                                    partial.push(quote(k) + (gap ? ": " : ":") + v)
                                }
                            }
                        }
                    } else {
                        for (k in value) {
                            if (Object.hasOwnProperty.call(value, k)) {
                                v = str(k, value, rep);
                                if (v) {
                                    partial.push(quote(k) + (gap ? ": " : ":") + v)
                                }
                            }
                        }
                    }
                    v = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}";
                    gap = mind;
                    return v
            }
        }

        return{stringify:function (value, replacer, space) {
            var i;
            gap = "";
            indent = "";
            if (typeof space === "number") {
                for (i = 0; i < space; i += 1) {
                    indent += " "
                }
            } else {
                if (typeof space === "string") {
                    indent = space
                }
            }
            rep = replacer;
            if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
                throw new Error("JSON.stringify")
            }
            return str("", {"":value})
        }, parse:function (text, reviver) {
            var j;

            function walk(holder, key) {
                var k, v, value = holder[key];
                if (value && typeof value === "object") {
                    for (k in value) {
                        if (Object.hasOwnProperty.call(value, k)) {
                            v = walk(value, k);
                            if (v !== undefined) {
                                value[k] = v
                            } else {
                                delete value[k]
                            }
                        }
                    }
                }
                return reviver.call(holder, key, value)
            }

            cx.lastIndex = 0;
            if (cx.test(text)) {
                text = text.replace(cx, function (a) {
                    return"\\u" + ("0000" + (+(a.charCodeAt(0))).toString(16)).slice(-4)
                })
            }
            if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
                j = eval("(" + text + ")");
                return typeof reviver === "function" ? walk({"":j}, "") : j
            }
            throw new SyntaxError("JSON.parse")
        }}
    }()
})(jQuery);
var TrimPath;
(function () {
    if (TrimPath == null) {
        TrimPath = new Object()
    }
    if (TrimPath.evalEx == null) {
        TrimPath.evalEx = function (src) {
            return eval(src)
        }
    }
    var UNDEFINED;
    if (Array.prototype.pop == null) {
        Array.prototype.pop = function () {
            if (this.length === 0) {
                return UNDEFINED
            }
            return this[--this.length]
        }
    }
    if (Array.prototype.push == null) {
        Array.prototype.push = function () {
            for (var i = 0; i < arguments.length; ++i) {
                this[this.length] = arguments[i]
            }
            return this.length
        }
    }
    TrimPath.parseTemplate = function (tmplContent, optTmplName, optEtc) {
        if (optEtc == null) {
            optEtc = TrimPath.parseTemplate_etc
        }
        var funcSrc = parse(tmplContent, optTmplName, optEtc);
        var func = TrimPath.evalEx(funcSrc, optTmplName, 1);
        if (func != null) {
            return new optEtc.Template(optTmplName, tmplContent, funcSrc, func, optEtc)
        }
        return null
    };
    try {
        String.prototype.process = function (context, optFlags) {
            var template = TrimPath.parseTemplate(this, null);
            if (template != null) {
                return template.process(context, optFlags)
            }
            return this
        }
    } catch (e) {
    }
    TrimPath.parseTemplate_etc = {};
    TrimPath.parseTemplate_etc.statementTag = "forelse|for|if|elseif|else|var|macro";
    TrimPath.parseTemplate_etc.statementDef = {"if":{delta:1, prefix:"if (", suffix:") {", paramMin:1}, "else":{delta:0, prefix:"} else {"}, elseif:{delta:0, prefix:"} else if (", suffix:") {", paramDefault:"true"}, "/if":{delta:-1, prefix:"}"}, "for":{delta:1, paramMin:3, prefixFunc:function (stmtParts, state, tmplName, etc) {
        if (stmtParts[2] != "in") {
            throw new etc.ParseError(tmplName, state.line, "bad for loop statement: " + stmtParts.join(" "))
        }
        var iterVar = stmtParts[1];
        var listVar = "__LIST__" + iterVar;
        return["var ", listVar, " = ", stmtParts[3], ";", "var __LENGTH_STACK__;", "if (typeof(__LENGTH_STACK__) == 'undefined' || !__LENGTH_STACK__.length) __LENGTH_STACK__ = new Array();", "__LENGTH_STACK__[__LENGTH_STACK__.length] = 0;", "if ((", listVar, ") != null) { ", "var ", iterVar, "_ct = 0;", "for (var ", iterVar, "_index in ", listVar, ") { ", iterVar, "_ct++;", "if (typeof(", listVar, "[", iterVar, "_index]) == 'function') {continue;}", "__LENGTH_STACK__[__LENGTH_STACK__.length - 1]++;", "var ", iterVar, " = ", listVar, "[", iterVar, "_index];"].join("")
    }}, forelse:{delta:0, prefix:"} } if (__LENGTH_STACK__[__LENGTH_STACK__.length - 1] == 0) { if (", suffix:") {", paramDefault:"true"}, "/for":{delta:-1, prefix:"} }; delete __LENGTH_STACK__[__LENGTH_STACK__.length - 1];"}, "var":{delta:0, prefix:"var ", suffix:";"}, macro:{delta:1, prefixFunc:function (stmtParts, state, tmplName, etc) {
        var macroName = stmtParts[1].split("(")[0];
        return["var ", macroName, " = function", stmtParts.slice(1).join(" ").substring(macroName.length), "{ var _OUT_arr = []; var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } }; "].join("")
    }}, "/macro":{delta:-1, prefix:" return _OUT_arr.join(''); };"}};
    TrimPath.parseTemplate_etc.modifierDef = {eat:function (v) {
        return""
    }, escape:function (s) {
        return String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")
    }, capitalize:function (s) {
        return String(s).toUpperCase()
    }, "default":function (s, d) {
        return s != null ? s : d
    }};
    TrimPath.parseTemplate_etc.modifierDef.h = TrimPath.parseTemplate_etc.modifierDef.escape;
    TrimPath.parseTemplate_etc.Template = function (tmplName, tmplContent, funcSrc, func, etc) {
        this.process = function (context, flags) {
            if (context == null) {
                context = {}
            }
            if (context._MODIFIERS == null) {
                context._MODIFIERS = {}
            }
            if (context.defined == null) {
                context.defined = function (str) {
                    return(context[str] != undefined)
                }
            }
            for (var k in etc.modifierDef) {
                if (context._MODIFIERS[k] == null) {
                    context._MODIFIERS[k] = etc.modifierDef[k]
                }
            }
            if (flags == null) {
                flags = {}
            }
            var resultArr = [];
            var resultOut = {write:function (m) {
                resultArr.push(m)
            }};
            try {
                func(resultOut, context, flags)
            } catch (e) {
                if (flags.throwExceptions == true) {
                    throw e
                }
                var result = new String(resultArr.join("") + "[ERROR: " + e.toString() + (e.message ? "; " + e.message : "") + "]");
                result.exception = e;
                return result
            }
            return resultArr.join("")
        };
        this.name = tmplName;
        this.source = tmplContent;
        this.sourceFunc = funcSrc;
        this.toString = function () {
            return"TrimPath.Template [" + tmplName + "]"
        }
    };
    TrimPath.parseTemplate_etc.ParseError = function (name, line, message) {
        this.name = name;
        this.line = line;
        this.message = message
    };
    TrimPath.parseTemplate_etc.ParseError.prototype.toString = function () {
        return("TrimPath template ParseError in " + this.name + ": line " + this.line + ", " + this.message)
    };
    var parse = function (body, tmplName, etc) {
        body = cleanWhiteSpace(body);
        var funcText = ["var TrimPath_Template_TEMP = function(_OUT, _CONTEXT, _FLAGS) { with (_CONTEXT) {"];
        var state = {stack:[], line:1};
        var endStmtPrev = -1;
        while (endStmtPrev + 1 < body.length) {
            var begStmt = endStmtPrev;
            begStmt = body.indexOf("{", begStmt + 1);
            while (begStmt >= 0) {
                var endStmt = body.indexOf("}", begStmt + 1);
                var stmt = body.substring(begStmt, endStmt);
                var blockrx = stmt.match(/^\{(cdata|minify|eval)/);
                if (blockrx) {
                    var blockType = blockrx[1];
                    var blockMarkerBeg = begStmt + blockType.length + 1;
                    var blockMarkerEnd = body.indexOf("}", blockMarkerBeg);
                    if (blockMarkerEnd >= 0) {
                        var blockMarker;
                        if (blockMarkerEnd - blockMarkerBeg <= 0) {
                            blockMarker = "{/" + blockType + "}"
                        } else {
                            blockMarker = body.substring(blockMarkerBeg + 1, blockMarkerEnd)
                        }
                        var blockEnd = body.indexOf(blockMarker, blockMarkerEnd + 1);
                        if (blockEnd >= 0) {
                            emitSectionText(body.substring(endStmtPrev + 1, begStmt), funcText);
                            var blockText = body.substring(blockMarkerEnd + 1, blockEnd);
                            if (blockType == "cdata") {
                                emitText(blockText, funcText)
                            } else {
                                if (blockType == "minify") {
                                    emitText(scrubWhiteSpace(blockText), funcText)
                                } else {
                                    if (blockType == "eval") {
                                        if (blockText != null && blockText.length > 0) {
                                            funcText.push("_OUT.write( (function() { " + blockText + " })() );")
                                        }
                                    }
                                }
                            }
                            begStmt = endStmtPrev = blockEnd + blockMarker.length - 1
                        }
                    }
                } else {
                    if (body.charAt(begStmt - 1) != "$" && body.charAt(begStmt - 1) != "\\") {
                        var offset = (body.charAt(begStmt + 1) == "/" ? 2 : 1);
                        if (body.substring(begStmt + offset, begStmt + 10 + offset).search(TrimPath.parseTemplate_etc.statementTag) == 0) {
                            break
                        }
                    }
                }
                begStmt = body.indexOf("{", begStmt + 1)
            }
            if (begStmt < 0) {
                break
            }
            var endStmt = body.indexOf("}", begStmt + 1);
            if (endStmt < 0) {
                break
            }
            emitSectionText(body.substring(endStmtPrev + 1, begStmt), funcText);
            emitStatement(body.substring(begStmt, endStmt + 1), state, funcText, tmplName, etc);
            endStmtPrev = endStmt
        }
        emitSectionText(body.substring(endStmtPrev + 1), funcText);
        if (state.stack.length != 0) {
            throw new etc.ParseError(tmplName, state.line, "unclosed, unmatched statement(s): " + state.stack.join(","))
        }
        funcText.push("}}; TrimPath_Template_TEMP");
        return funcText.join("")
    };
    var emitStatement = function (stmtStr, state, funcText, tmplName, etc) {
        var parts = stmtStr.slice(1, -1).split(" ");
        var stmt = etc.statementDef[parts[0]];
        if (stmt == null) {
            emitSectionText(stmtStr, funcText);
            return
        }
        if (stmt.delta < 0) {
            if (state.stack.length <= 0) {
                throw new etc.ParseError(tmplName, state.line, "close tag does not match any previous statement: " + stmtStr)
            }
            state.stack.pop()
        }
        if (stmt.delta > 0) {
            state.stack.push(stmtStr)
        }
        if (stmt.paramMin != null && stmt.paramMin >= parts.length) {
            throw new etc.ParseError(tmplName, state.line, "statement needs more parameters: " + stmtStr)
        }
        if (stmt.prefixFunc != null) {
            funcText.push(stmt.prefixFunc(parts, state, tmplName, etc))
        } else {
            funcText.push(stmt.prefix)
        }
        if (stmt.suffix != null) {
            if (parts.length <= 1) {
                if (stmt.paramDefault != null) {
                    funcText.push(stmt.paramDefault)
                }
            } else {
                for (var i = 1; i < parts.length; i++) {
                    if (i > 1) {
                        funcText.push(" ")
                    }
                    funcText.push(parts[i])
                }
            }
            funcText.push(stmt.suffix)
        }
    };
    var emitSectionText = function (text, funcText) {
        if (text.length <= 0) {
            return
        }
        var nlPrefix = 0;
        var nlSuffix = text.length - 1;
        while (nlPrefix < text.length && (text.charAt(nlPrefix) == "\n")) {
            nlPrefix++
        }
        while (nlSuffix >= 0 && (text.charAt(nlSuffix) == " " || text.charAt(nlSuffix) == "\t")) {
            nlSuffix--
        }
        if (nlSuffix < nlPrefix) {
            nlSuffix = nlPrefix
        }
        if (nlPrefix > 0) {
            funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');
            var s = text.substring(0, nlPrefix).replace("\n", "\\n");
            if (s.charAt(s.length - 1) == "\n") {
                s = s.substring(0, s.length - 1)
            }
            funcText.push(s);
            funcText.push('");')
        }
        var lines = text.substring(nlPrefix, nlSuffix + 1).split("\n");
        for (var i = 0; i < lines.length; i++) {
            emitSectionTextLine(lines[i], funcText);
            if (i < lines.length - 1) {
                funcText.push('_OUT.write("\\n");\n')
            }
        }
        if (nlSuffix + 1 < text.length) {
            funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');
            var s = text.substring(nlSuffix + 1).replace("\n", "\\n");
            if (s.charAt(s.length - 1) == "\n") {
                s = s.substring(0, s.length - 1)
            }
            funcText.push(s);
            funcText.push('");')
        }
    };
    var emitSectionTextLine = function (line, funcText) {
        var endMarkPrev = "}";
        var endExprPrev = -1;
        while (endExprPrev + endMarkPrev.length < line.length) {
            var begMark = "${",endMark="}";
            var begExpr = line.indexOf(begMark, endExprPrev + endMarkPrev.length);
            if (begExpr < 0) {
                break
            }
            if (line.charAt(begExpr + 2) == "%") {
                begMark = "${%";endMark="%}"
            }
            var endExpr = line.indexOf(endMark, begExpr + begMark.length);
            if (endExpr < 0) {
                break
            }
            emitText(line.substring(endExprPrev + endMarkPrev.length, begExpr), funcText);
            var exprArr = line.substring(begExpr + begMark.length, endExpr).replace(/\|\|/g, "#@@#").split("|");
            for (var k in exprArr) {
                if (exprArr[k].replace) {
                    exprArr[k] = exprArr[k].replace(/#@@#/g, "||")
                }
            }
            funcText.push("_OUT.write(");
            emitExpression(exprArr, exprArr.length - 1, funcText);
            funcText.push(");");
            endExprPrev = endExpr;
            endMarkPrev = endMark
        }
        emitText(line.substring(endExprPrev + endMarkPrev.length), funcText)
    };
    var emitText = function (text, funcText) {
        if (text == null || text.length <= 0) {
            return
        }
        text = text.replace(/\\/g, "\\\\");
        text = text.replace(/\n/g, "\\n");
        text = text.replace(/"/g, '\\"');
        funcText.push('_OUT.write("');
        funcText.push(text);
        funcText.push('");')
    };
    var emitExpression = function (exprArr, index, funcText) {
        var expr = exprArr[index];
        if (index <= 0) {
            funcText.push(expr);
            return
        }
        var parts = expr.split(":");
        funcText.push('_MODIFIERS["');
        funcText.push(parts[0]);
        funcText.push('"](');
        emitExpression(exprArr, index - 1, funcText);
        if (parts.length > 1) {
            funcText.push(",");
            funcText.push(parts[1])
        }
        funcText.push(")")
    };
    var cleanWhiteSpace = function (result) {
        result = result.replace(/\t/g, "    ");
        result = result.replace(/\r\n/g, "\n");
        result = result.replace(/\r/g, "\n");
        result = result.replace(/^(\s*\S*(\s+\S+)*)\s*$/, "$1");
        return result
    };
    var scrubWhiteSpace = function (result) {
        result = result.replace(/^\s+/g, "");
        result = result.replace(/\s+$/g, "");
        result = result.replace(/\s+/g, " ");
        result = result.replace(/^(\s*\S*(\s+\S+)*)\s*$/, "$1");
        return result
    };
    TrimPath.parseDOMTemplate = function (elementId, optDocument, optEtc) {
        if (optDocument == null) {
            optDocument = document
        }
        var element = optDocument.getElementById(elementId);
        var content = element.value;
        if (content == null) {
            content = element.innerHTML
        }
        content = content.replace(/</g, "<").replace(/>/g, ">");
        return TrimPath.parseTemplate(content, elementId, optEtc)
    };
    TrimPath.processDOMTemplate = function (elementId, context, optFlags, optDocument, optEtc) {
        return TrimPath.parseDOMTemplate(elementId, optDocument, optEtc).process(context, optFlags)
    }
})();
(function ($) {
    $.extend({_jsonp:{scripts:{}, counter:1, charset:"gb2312", head:document.getElementsByTagName("head")[0], name:function (callback) {
        var name = "_jsonp_" + (new Date).getTime() + "_" + this.counter;
        this.counter++;
        var cb = function (json) {
            eval("delete " + name);
            callback(json);
            $._jsonp.head.removeChild($._jsonp.scripts[name]);
            delete $._jsonp.scripts[name]
        };
        eval(name + " = cb");
        return name
    }, load:function (url, name) {
        var script = document.createElement("script");
        script.type = "text/javascript";
        script.charset = this.charset;
        script.src = url;
        this.head.appendChild(script);
        this.scripts[name] = script
    }}, getJSONP:function (url, callback) {
        var name = $._jsonp.name(callback);
        var url = url.replace(/{callback};/, name);
        $._jsonp.load(url, name);
        return this
    }})
})(jQuery);
(function (b) {
    b.fn.Jdropdown = function (g, f) {
        if (!this.length) {
            return
        }
        if (typeof g == "function") {
            f = g;
            g = {}
        }
        var h = b.extend({event:"mouseover", current:"hover", delay:0}, g || {});
        var a = (h.event == "mouseover") ? "mouseout" : "mouseleave";
        b.each(this, function () {
            var c = null, d = null, e = false;
            b(this).bind(h.event,function () {
                if (e) {
                    clearTimeout(d)
                } else {
                    var k = b(this);
                    c = setTimeout(function () {
                        k.addClass(h.current);
                        e = true;
                        if (f) {
                            f(k)
                        }
                    }, h.delay)
                }
            }).bind(a, function () {
                if (e) {
                    var k = b(this);
                    d = setTimeout(function () {
                        k.removeClass(h.current);
                        e = false
                    }, h.delay)
                } else {
                    clearTimeout(c)
                }
            })
        })
    }
})(jQuery);
(function (b) {
    b.fn.Jtab = function (q, m) {
        if (!this.length) {
            return
        }
        if (typeof q == "function") {
            m = q;
            q = {}
        }
        var s = b.extend({type:"static", auto:false, event:"mouseover", currClass:"curr", source:"data-tag", hookKey:"data-widget", hookItemVal:"tab-item", hookContentVal:"tab-content", stay:5000, delay:100, threshold:null, mainTimer:null, subTimer:null, index:0, compatible:false}, q || {});
        var o = b(this).find("*[" + s.hookKey + "=" + s.hookItemVal + "]"), p = b(this).find("*[" + s.hookKey + "=" + s.hookContentVal + "]"), a = s.source.toLowerCase().match(/http:\/\/|\d|\.aspx|\.ascx|\.asp|\.php|\.html\.htm|.shtml|.js/g);
        if (o.length != p.length) {
            return false
        }
        var l = function (c, d) {
            s.subTimer = setTimeout(function () {
                o.eq(s.index).removeClass(s.currClass);
                if (s.compatible) {
                    p.eq(s.index).hide()
                }
                if (d) {
                    s.index++;
                    if (s.index == o.length) {
                        s.index = 0
                    }
                } else {
                    s.index = c
                }
                s.type = (o.eq(s.index).attr(s.source) != null) ? "dynamic" : "static";
                r()
            }, s.delay)
        };
        var n = function () {
            s.mainTimer = setInterval(function () {
                l(s.index, true)
            }, s.stay)
        };
        var r = function () {
            o.eq(s.index).addClass(s.currClass);
            if (s.compatible) {
                p.eq(s.index).show()
            }
            switch (s.type) {
                default:
                case"static":
                    var c = "";
                    break;
                case"dynamic":
                    var c = (!a) ? o.eq(s.index).attr(s.source) : s.source;
                    o.eq(s.index).removeAttr(s.source);
                    break
            }
            if (m) {
                m(c, p.eq(s.index), s.index)
            }
        };
        o.each(function (c) {
            b(this).bind(s.event,function () {
                clearTimeout(s.subTimer);
                clearInterval(s.mainTimer);
                l(c, false)
            }).bind("mouseleave", function () {
                if (s.auto) {
                    n()
                } else {
                    return
                }
            })
        });
        if (s.type == "dynamic") {
            l(s.index, false)
        }
        if (s.auto) {
            n()
        }
    }
})(jQuery);
(function (b) {
    b.fn.Jlazyload = function (v, r) {
        if (!this.length) {
            return
        }
        var y = b.extend({type:null, offsetParent:null, source:"data-lazyload", placeholderImage:"http://misc.360buyimg.com/lib/img/e/blank.gif", placeholderClass:"loading-style2", threshold:200}, v || {}), u = this, x, s, t = function (f) {
            var c = f.scrollLeft, d = f.scrollTop, e = f.offsetWidth, g = f.offsetHeight;
            while (f.offsetParent) {
                c += f.offsetLeft;
                d += f.offsetTop;
                f = f.offsetParent
            }
            return{left:c, top:d, width:e, height:g}
        }, z = function () {
            var c = document.documentElement, g = document.body, d = window.pageXOffset ? window.pageXOffset : (c.scrollLeft || g.scrollLeft), e = window.pageYOffset ? window.pageYOffset : (c.scrollTop || g.scrollTop), f = c.clientWidth, h = c.clientHeight;
            return{left:d, top:e, width:f, height:h}
        }, A = function (h, j) {
            var f, g, l, c, d, k, e = y.threshold ? parseInt(y.threshold) : 0;
            f = h.left + h.width / 2;
            g = j.left + j.width / 2;
            l = h.top + h.height / 2;
            c = j.top + j.height / 2;
            d = (h.width + j.width) / 2;
            k = (h.height + j.height) / 2;
            return Math.abs(f - g) < (d + e) && Math.abs(l - c) < (k + e)
        }, C = function (e, c, d) {
            if (y.placeholderImage && y.placeholderClass) {
                d.attr("src", y.placeholderImage).addClass(y.placeholderClass)
            }
            if (e) {
                d.attr("src", c).removeAttr(y.source);
                if (r) {
                    r(c, d)
                }
            }
        }, B = function (f, c, e) {
            if (f) {
                var d = b("#" + c);
                d.html(e.val()).removeAttr(y.source);
                e.remove();
                if (r) {
                    r(c, e)
                }
            }
        }, a = function (e, c, d) {
            if (e) {
                d.removeAttr(y.source);
                if (r) {
                    r(c, d)
                }
            }
        }, q = function () {
            s = z(), u = u.filter(function () {
                return b(this).attr(y.source)
            });
            b.each(u, function () {
                var c = b(this).attr(y.source);
                if (!c) {
                    return
                }
                var d = (!y.offsetParent) ? s : t(b(y.offsetParent).get(0)), e = t(this), f = A(d, e);
                switch (y.type) {
                    case"image":
                        C(f, c, b(this));
                        break;
                    case"textarea":
                        B(f, c, b(this));
                        break;
                    case"module":
                        a(f, c, b(this));
                        break;
                    default:
                        break
                }
            })
        }, w = function () {
            if (u.length > 0) {
                clearTimeout(x);
                x = setTimeout(function () {
                    q()
                }, 10)
            }
        };
        q();
        if (!y.offsetParent) {
            b(window).bind("scroll",function () {
                w()
            }).bind("reset", function () {
                w()
            })
        } else {
            b(y.offsetParent).bind("scroll", function () {
                w()
            })
        }
    }
})(jQuery);
(function (b) {
    b.Jtimer = function (n, j) {
        var o = b.extend({pids:null, template:null, reset:null, mainPlaceholder:"timed", subPlaceholder:"timer", resetPlaceholder:"reset", iconPlaceholder:"icon", finishedClass:"", timer:[]}, n || {}), k = function (d) {
            var e = d.split(" "), f = e[0].split("-"), c = e[1].split(":");
            return new Date(f[0], f[1] - 1, f[2], c[0], c[1], c[2])
        }, m = function (c) {
            if (String(c).length < 2) {
                c = "0" + c
            }
            return c
        }, l = function (D, e) {
            if (e == {} || !e || !e.start || !e.end) {
                return
            }
            var z = k(e.start), x = k(e.server), g = k(e.end), B, C, f, E = (z - x) / 1000, h = (g - x) / 1000, A = "#" + o.mainPlaceholder + D, y = "#" + o.subPlaceholder + e.qid, c = "#" + o.resetPlaceholder + e.qid;
            if (E <= 0) {
                var d = o.template.process(e);
                b(A).html(d)
            }
            o.timer[e.qid] = setInterval(function () {
                if (E > 0) {
                    clearInterval(o.timer[e.qid]);
                    return
                } else {
                    if (h > 0) {
                        B = Math.floor(h / 3600);
                        C = Math.floor((h - B * 3600) / 60);
                        f = (h - B * 3600) % 60;
                        b(y).html("\u5269\u4f59<b>" + m(B) + "</b>\u5c0f\u65f6<b>" + m(C) + "</b>\u5206<b>" + m(f) + "</b>\u79d2");
                        h--
                    } else {
                        b(y).html("\u62a2\u8d2d\u7ed3\u675f\uff01");
                        if (o.iconPlaceholder) {
                            iconElement = "#" + o.iconPlaceholder + e.qid;
                            b(iconElement).attr("class", o.finishedClass).html("\u62a2\u5b8c")
                        }
                        if (o.reset) {
                            b(y).append('<a href="javascript:void(0)" id="' + c.substring(1) + '">\u5237\u65b0</a>');
                            b(c).bind("click", function () {
                                b.each(o.timer, function (p) {
                                    clearInterval(this)
                                });
                                o.reset()
                            })
                        }
                        clearInterval(o.timer[e.qid])
                    }
                }
            }, 1000)
        }, a = function (c, d) {
            return((k(c.end) - k(c.server)) - (k(d.end) - k(d.server)))
        };
        b.ajax({url:"http://qiang.jd.com/HomePageNewLimitBuy.ashx?callback=?", data:{ids:o.pids}, dataType:"jsonp", success:function (c) {
            if (c && c.data) {
                c.data.sort(a);
                b.each(c.data, function (d) {
                    l((d + 1), c.data[d])
                })
            }
            if (j) {
                j()
            }
        }})
    }
})(jQuery);
(function (b) {
    b.fn.Jslider = function (u, p) {
        if (!this.length) {
            return
        }
        if (typeof u == "function") {
            p = u;
            u = {}
        }
        var y = b.extend({auto:false, reInit:false, data:[], defaultIndex:0, slideWidth:0, slideHeight:0, slideDirection:1, speed:"normal", stay:5000, delay:150, maxAmount:null, template:null, showControls:true}, u || {});
        var v = b(this), x = null, s = null, t = null, z = null, q = null, a = function () {
            var h;
            if (y.maxAmount && y.maxAmount < y.data.length) {
                y.data.splice(y.maxAmount)
            }
            if (typeof y.data == "object") {
                if (y.data.length) {
                    h = {};
                    h.json = y.data
                } else {
                    h = y.data
                }
            }
            var f = y.template;
            if (y.reInit) {
                var e, c = f.controlsContent.process(h);
                h.json = h.json.slice(1);
                e = f.itemsContent.process(h);
                v.find(".slide-items").eq(0).append(e);
                v.find(".slide-controls").eq(0).html(c)
            } else {
                var d = f.itemsWrap.replace("{innerHTML}", f.itemsContent) + f.controlsWrap.replace("{innerHTML}", f.controlsContent), g = d.process(h);
                v.html(g)
            }
            x = v.find(".slide-items");
            s = v.find(".slide-controls");
            t = s.find("span");
            w();
            r();
            if (p) {
                p(v)
            }
        }, w = function () {
            t.bind("mouseover",function () {
                var c = t.index(this);
                if (c == y.defaultIndex) {
                    return
                }
                clearTimeout(q);
                clearInterval(z);
                q = setTimeout(function () {
                    A(c)
                }, y.delay)
            }).bind("mouseleave", function () {
                clearTimeout(q);
                clearInterval(z);
                r()
            });
            x.bind("mouseover",function () {
                clearTimeout(q);
                clearInterval(z)
            }).bind("mouseleave", function () {
                r()
            })
        }, A = function (h) {
            t.each(function (j) {
                if (j == h) {
                    b(this).addClass("curr")
                } else {
                    b(this).removeClass("curr")
                }
            });
            var c = 0, d = 0;
            if (y.slideDirection == 3) {
                var g = x.children(), f = g.eq(y.defaultIndex), e = g.eq(h);
                f.css({zIndex:0});
                e.css({zIndex:1});
                f.fadeOut("fase");
                e.fadeIn("slow");
                y.defaultIndex = h
            } else {
                if (y.slideDirection == 1) {
                    x.css({width:y.slideWidth * y.data.length});
                    c = -y.slideWidth * h
                } else {
                    d = -y.slideHeight * h
                }
                x.animate({top:d + "px", left:c + "px"}, y.speed, function () {
                    y.defaultIndex = h
                })
            }
        }, r = function () {
            if (y.auto) {
                z = setInterval(function () {
                    var c = y.defaultIndex;
                    c++;
                    if (c == y.data.length) {
                        c = 0
                    }
                    A(c)
                }, y.stay)
            }
        };
        a()
    }
})(jQuery);
jQuery.fn.pagination = function (d, c) {
    c = jQuery.extend({items_per_page:10, num_display_entries:10, current_page:0, num_edge_entries:0, link_to:"#", prev_text:"Prev", next_text:"Next", ellipse_text:"...", prev_show_always:true, next_show_always:true, callback:function () {
        return false
    }}, c || {});
    return this.each(function () {
        function j() {
            return Math.ceil(d / c.items_per_page)
        }

        function a() {
            var f = Math.ceil(c.num_display_entries / 2);
            var e = j();
            var g = e - c.num_display_entries;
            var o = b > f ? Math.max(Math.min(b - f, g), 0) : 0;
            var h = b > f ? Math.min(b + f, e) : Math.min(c.num_display_entries, e);
            return[o, h]
        }

        function k(f, g) {
            b = f;
            m();
            var e = c.callback(f, l);
            if (!e) {
                if (g.stopPropagation) {
                    g.stopPropagation()
                } else {
                    g.cancelBubble = true
                }
            }
            return e
        }

        function m() {
            l.empty();
            var g = a();
            var r = j();
            if (r == 1) {
                $(".Pagination").css({display:"none"})
            }
            var q = function (n) {
                return function (o) {
                    return k(n, o)
                }
            };
            var s = function (p, o) {
                p = p < 0 ? 0 : (p < r ? p : r - 1);
                o = jQuery.extend({text:p + 1, classes:""}, o || {});
                if (p == b) {
                    var n = $("<a href='javascript:void(0)' class='current'>" + (o.text) + "</a>")
                } else {
                    var n = $("<a>" + (o.text) + "</a>").bind("click", q(p)).attr("href", c.link_to.replace(/__id__/, p))
                }
                if (o.classes) {
                    n.addClass(o.classes)
                }
                l.append(n)
            };
            if (c.prev_text && (b > 0 || c.prev_show_always)) {
                s(b - 1, {text:c.prev_text, classes:"prev"})
            }
            if (g[0] > 0 && c.num_edge_entries > 0) {
                var h = Math.min(c.num_edge_entries, g[0]);
                for (var f = 0; f < h; f++) {
                    s(f)
                }
                if (c.num_edge_entries < g[0] && c.ellipse_text) {
                    jQuery("<span>" + c.ellipse_text + "</span>").appendTo(l)
                }
            }
            for (var f = g[0]; f < g[1]; f++) {
                s(f)
            }
            if (g[1] < r && c.num_edge_entries > 0) {
                if (r - c.num_edge_entries > g[1] && c.ellipse_text) {
                    jQuery("<span>" + c.ellipse_text + "</span>").appendTo(l)
                }
                var e = Math.max(r - c.num_edge_entries, g[1]);
                for (var f = e; f < r; f++) {
                    s(f)
                }
            }
            if (c.next_text && (b < r - 1 || c.next_show_always)) {
                s(b + 1, {text:c.next_text, classes:"next"})
            }
        }

        var b = c.current_page;
        d = (!d || d < 0) ? 1 : d;
        c.items_per_page = (!c.items_per_page || c.items_per_page < 0) ? 1 : c.items_per_page;
        var l = jQuery(this);
        this.selectPage = function (e) {
            k(e)
        };
        this.prevPage = function () {
            if (b > 0) {
                k(b - 1);
                return true
            } else {
                return false
            }
        };
        this.nextPage = function () {
            if (b < j() - 1) {
                k(b + 1);
                return true
            } else {
                return false
            }
        };
        m()
    })
};
(function (b) {
    b.extend(b.browser, {client:function () {
        return{width:document.documentElement.clientWidth, height:document.documentElement.clientHeight, bodyWidth:document.body.clientWidth, bodyHeight:document.body.clientHeight}
    }, scroll:function () {
        return{width:document.documentElement.scrollWidth, height:document.documentElement.scrollHeight, bodyWidth:document.body.scrollWidth, bodyHeight:document.body.scrollHeight, left:document.documentElement.scrollLeft + document.body.scrollLeft, top:document.documentElement.scrollTop + document.body.scrollTop}
    }, screen:function () {
        return{width:window.screen.width, height:window.screen.height}
    }, isMinH:function (a) {
        return b.browser.client().height <= a
    }})
})(jQuery);
(function (b) {
    b.fn.jdPosition = function (j) {
        var k = b.extend({mode:null}, j || {});
        switch (k.mode) {
            default:
            case"center":
                var m = b(this).outerWidth(), h = b(this).outerHeight();
                var a = b.browser.isMinW(m), l = b.browser.isMinH(h);
                b(this).css({left:b.browser.scroll().left + Math.max((b.browser.client().width - m) / 2, 0) + "px", top:(!b.browser.isIE6) ? (l ? b.browser.scroll().top : (b.browser.scroll().top + Math.max((b.browser.client().height - h) / 2, 0) + "px")) : ((b.browser.scroll().top <= b.browser.client().bodyHeight - h) ? (b.browser.scroll().top + Math.max((b.browser.client().height - h) / 2, 0) + "px") : (b.browser.client().bodyHeight - h) + "px")});
                break;
            case"auto":
                break;
            case"fixed":
                break
        }
    }
})(jQuery);
(function (b) {
    b.fn.jdThickBox = function (w, s) {
        if (typeof w == "function") {
            s = w;
            w = {}
        }
        var a = b.extend({type:"text", source:null, width:null, height:null, title:null, _frame:"", _div:"", _box:"", _con:"", _loading:"thickloading", close:false, _close:"", _fastClose:false, _close_val:"\u951f\u65a4\u62f7", _titleOn:true, _title:"", _autoReposi:false, _countdown:false}, w || {});
        var x = (typeof this != "function") ? b(this) : null;
        var z;
        var q = function () {
            clearInterval(z);
            b(".thickframe").add(".thickdiv").hide();
            b(".thickbox").empty().remove();
            if (a._autoReposi) {
                b(window).unbind("resize.jdThickBox").unbind("scroll.jdThickBox")
            }
        };
        if (a.close) {
            q();
            return false
        }
        var y = function (c) {
            if (c != "") {
                return c.match(/\w+/)
            } else {
                return""
            }
        };
        var p = function (c) {
            if (b(".thickframe").length == 0 || b(".thickdiv").length == 0) {
                b("<iframe class='thickframe' id='" + y(a._frame) + "' marginwidth='0' marginheight='0' frameborder='0' scrolling='no'></iframe>").appendTo(b(document.body));
                b("<div class='thickdiv' id='" + y(a._div) + "'></div>").appendTo(b(document.body))
            } else {
                b(".thickframe").add(".thickdiv").show()
            }
            b("<div class='thickbox' id='" + y(a._box) + "'></div>").appendTo(b(document.body));
            if (a._titleOn) {
                u(c)
            }
            b("<div class='thickcon' id='" + y(a._con) + "' style='width:" + a.width + "px;height:" + a.height + "px;'></div>").appendTo(b(".thickbox"));
            if (a._countdown) {
                A()
            }
            b(".thickcon").addClass(a._loading);
            v();
            t();
            r(c);
            if (a._autoReposi) {
                b(window).bind("resize.jdThickBox", v).bind("scroll.jdThickBox", v)
            }
            if (a._fastClose) {
                b(document.body).bind("click.jdThickBox", function (d) {
                    d = d ? d : window.event;
                    var e = d.srcElement ? d.srcElement : d.target;
                    if (e.className == "thickdiv") {
                        b(this).unbind("click.jdThickBox");
                        q()
                    }
                })
            }
        };
        var A = function () {
            var c = a._countdown;
            b("<div class='thickcountdown' style='width:" + a.width + "'><span id='jd-countdown'>" + c + "</span>\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u8fdc\u951f\u65a4\u62f7\u4e47\u951f\ufffd/div>").appendTo(b(".thickbox"));
            z = setInterval(function () {
                c--;
                b("#jd-countdown").html(c);
                if (c == 0) {
                    c = a._countdown;
                    q()
                }
            }, 1000)
        };
        var u = function (c) {
            a.title = (a.title == null && c) ? c.attr("title") : a.title;
            b("<div class='thicktitle' id='" + y(a._title) + "' style='width:" + a.width + "'><span>" + a.title + "</span></div>").appendTo(b(".thickbox"))
        };
        var t = function () {
            if (a._close != null) {
                b("<a href='#' class='thickclose' id='" + y(a._close) + "'>" + a._close_val + "</a>").appendTo(b(".thickbox"));
                b(".thickclose").one("click", function () {
                    q();
                    return false
                })
            }
        };
        var r = function (c) {
            a.source = (a.source == null) ? c.attr("href") : a.source;
            switch (a.type) {
                default:
                case"text":
                    b(".thickcon").html(a.source);
                    b(".thickcon").removeClass(a._loading);
                    if (s) {
                        s()
                    }
                    break;
                case"html":
                    b(a.source).clone().appendTo(b(".thickcon")).show();
                    b(".thickcon").removeClass(a._loading);
                    if (s) {
                        s()
                    }
                    break;
                case"image":
                    a._index = (a._index == null) ? x.index(c) : a._index;
                    b(".thickcon").append("<img src='" + a.source + "' width='" + a.width + "' height='" + a.height + "'>");
                    a.source = null;
                    b(".thickcon").removeClass(a._loading);
                    if (s) {
                        s()
                    }
                    break;
                case"ajax":
                case"json":
                    if (s) {
                        s(a.source, b(".thickcon"), function () {
                            b(".thickcon").removeClass(a._loading)
                        })
                    }
                    break;
                case"iframe":
                    b("<iframe src='" + a.source + "' marginwidth='0' marginheight='0' frameborder='0' scrolling='no' style='width:" + a.width + "px;height:" + a.height + "px;border:0;'></iframe>").appendTo(b(".thickcon"));
                    b(".thickcon").removeClass(a._loading);
                    if (s) {
                        s()
                    }
                    break
            }
        };
        var v = function () {
            var g = b(".thickcon").outerWidth(), d = (a._titleOn ? b(".thicktitle").outerHeight() : 0) + b(".thickcon").outerHeight();
            b(".thickbox").css({width:g + "px", height:d + "px"});
            b(".thickbox").jdPosition({mode:"center"});
            if (b.browser.isIE6) {
                var e = b(".thickbox").outerWidth(), c = b(".thickbox").outerHeight();
                var h = b.browser.isMinW(e), f = b.browser.isMinH(c);
                b(".thickframe").add(".thickdiv").css({width:h ? e : "100%", height:Math.max(b.browser.client().height, b.browser.client().bodyHeight) + "px"})
            }
        };
        if (x != null) {
            x.click(function () {
                p(b(this));
                return false
            })
        } else {
            p()
        }
    };
    b.jdThickBox = b.fn.jdThickBox
})(jQuery);
function jdThickBoxclose() {
    $(".thickclose").trigger("click")
}
(function (b) {
    b.fn.jdMarquee = function (E, K) {
        if (typeof E == "function") {
            K = E;
            E = {}
        }
        var D = b.extend({deriction:"up", speed:10, auto:false, width:null, height:null, step:1, control:false, _front:null, _back:null, _stop:null, _continue:null, wrapstyle:"", stay:5000, delay:20, dom:"div>ul>li".split(">"), mainTimer:null, subTimer:null, tag:false, convert:false, btn:null, disabled:"disabled", pos:{ojbect:null, clone:null}}, E || {});
        var a = this.find(D.dom[1]);
        var H = this.find(D.dom[2]);
        var v;
        if (D.deriction == "up" || D.deriction == "down") {
            var B = a.eq(0).outerHeight();
            var J = D.step * H.eq(0).outerHeight();
            a.css({width:D.width + "px", overflow:"hidden"})
        }
        if (D.deriction == "left" || D.deriction == "right") {
            var z = H.length * H.eq(0).outerWidth();
            a.css({width:z + "px", overflow:"hidden"});
            var J = D.step * H.eq(0).outerWidth()
        }
        var y = function () {
            var c = "<div style='position:relative;overflow:hidden;z-index:1;width:" + D.width + "px;height:" + D.height + "px;" + D.wrapstyle + "'></div>";
            a.css({position:"absolute", left:0, top:0}).wrap(c);
            D.pos.object = 0;
            v = a.clone();
            a.after(v);
            switch (D.deriction) {
                default:
                case"up":
                    a.css({marginLeft:0, marginTop:0});
                    v.css({marginLeft:0, marginTop:B + "px"});
                    D.pos.clone = B;
                    break;
                case"down":
                    a.css({marginLeft:0, marginTop:0});
                    v.css({marginLeft:0, marginTop:-B + "px"});
                    D.pos.clone = -B;
                    break;
                case"left":
                    a.css({marginTop:0, marginLeft:0});
                    v.css({marginTop:0, marginLeft:z + "px"});
                    D.pos.clone = z;
                    break;
                case"right":
                    a.css({marginTop:0, marginLeft:0});
                    v.css({marginTop:0, marginLeft:-z + "px"});
                    D.pos.clone = -z;
                    break
            }
            if (D.auto) {
                C();
                a.hover(function () {
                    A(D.mainTimer)
                }, function () {
                    C()
                });
                v.hover(function () {
                    A(D.mainTimer)
                }, function () {
                    C()
                })
            }
            if (K) {
                K()
            }
            if (D.control) {
                F()
            }
        };
        var C = function (c) {
            A(D.mainTimer);
            D.stay = c ? c : D.stay;
            D.mainTimer = setInterval(function () {
                s()
            }, D.stay)
        };
        var s = function () {
            A(D.subTimer);
            D.subTimer = setInterval(function () {
                w()
            }, D.delay)
        };
        var A = function (c) {
            if (c != null) {
                clearInterval(c)
            }
        };
        var x = function (c) {
            if (c) {
                b(D._front).unbind("click");
                b(D._back).unbind("click");
                b(D._stop).unbind("click");
                b(D._continue).unbind("click")
            } else {
                F()
            }
        };
        var F = function () {
            if (D._front != null) {
                b(D._front).click(function () {
                    b(D._front).addClass(D.disabled);
                    x(true);
                    A(D.mainTimer);
                    D.convert = true;
                    D.btn = "front";
                    s();
                    if (!D.auto) {
                        D.tag = true
                    }
                    G()
                })
            }
            if (D._back != null) {
                b(D._back).click(function () {
                    b(D._back).addClass(D.disabled);
                    x(true);
                    A(D.mainTimer);
                    D.convert = true;
                    D.btn = "back";
                    s();
                    if (!D.auto) {
                        D.tag = true
                    }
                    G()
                })
            }
            if (D._stop != null) {
                b(D._stop).click(function () {
                    A(D.mainTimer)
                })
            }
            if (D._continue != null) {
                b(D._continue).click(function () {
                    C()
                })
            }
        };
        var G = function () {
            if (D.tag && D.convert) {
                D.convert = false;
                if (D.btn == "front") {
                    if (D.deriction == "down") {
                        D.deriction = "up"
                    }
                    if (D.deriction == "right") {
                        D.deriction = "left"
                    }
                }
                if (D.btn == "back") {
                    if (D.deriction == "up") {
                        D.deriction = "down"
                    }
                    if (D.deriction == "left") {
                        D.deriction = "right"
                    }
                }
                if (D.auto) {
                    C()
                } else {
                    C(4 * D.delay)
                }
            }
        };
        var I = function (c, d, e) {
            if (e) {
                A(D.subTimer);
                D.pos.object = c;
                D.pos.clone = d;
                D.tag = true
            } else {
                D.tag = false
            }
            if (D.tag) {
                if (D.convert) {
                    G()
                } else {
                    if (!D.auto) {
                        A(D.mainTimer)
                    }
                }
            }
            if (D.deriction == "up" || D.deriction == "down") {
                a.css({marginTop:c + "px"});
                v.css({marginTop:d + "px"})
            }
            if (D.deriction == "left" || D.deriction == "right") {
                a.css({marginLeft:c + "px"});
                v.css({marginLeft:d + "px"})
            }
        };
        var w = function () {
            var e = (D.deriction == "up" || D.deriction == "down") ? parseInt(a.get(0).style.marginTop) : parseInt(a.get(0).style.marginLeft);
            var d = (D.deriction == "up" || D.deriction == "down") ? parseInt(v.get(0).style.marginTop) : parseInt(v.get(0).style.marginLeft);
            var c = Math.max(Math.abs(e - D.pos.object), Math.abs(d - D.pos.clone));
            var f = Math.ceil((J - c) / D.speed);
            switch (D.deriction) {
                case"up":
                    if (c == J) {
                        I(e, d, true);
                        b(D._front).removeClass(D.disabled);
                        x(false)
                    } else {
                        if (e <= -B) {
                            e = d + B;
                            D.pos.object = e
                        }
                        if (d <= -B) {
                            d = e + B;
                            D.pos.clone = d
                        }
                        I((e - f), (d - f))
                    }
                    break;
                case"down":
                    if (c == J) {
                        I(e, d, true);
                        b(D._back).removeClass(D.disabled);
                        x(false)
                    } else {
                        if (e >= B) {
                            e = d - B;
                            D.pos.object = e
                        }
                        if (d >= B) {
                            d = e - B;
                            D.pos.clone = d
                        }
                        I((e + f), (d + f))
                    }
                    break;
                case"left":
                    if (c == J) {
                        I(e, d, true);
                        b(D._front).removeClass(D.disabled);
                        x(false)
                    } else {
                        if (e <= -z) {
                            e = d + z;
                            D.pos.object = e
                        }
                        if (d <= -z) {
                            d = e + z;
                            D.pos.clone = d
                        }
                        I((e - f), (d - f))
                    }
                    break;
                case"right":
                    if (c == J) {
                        I(e, d, true);
                        b(D._back).removeClass(D.disabled);
                        x(false)
                    } else {
                        if (e >= z) {
                            e = d - z;
                            D.pos.object = e
                        }
                        if (d >= z) {
                            d = e - z;
                            D.pos.clone = d
                        }
                        I((e + f), (d + f))
                    }
                    break
            }
        };
        if (D.deriction == "up" || D.deriction == "down") {
            if (B >= D.height && B >= D.step) {
                y()
            }
        }
        if (D.deriction == "left" || D.deriction == "right") {
            if (z >= D.width && z >= D.step) {
                y()
            }
        }
    }
})(jQuery);
$.login = function (b) {
    b = $.extend({loginService:"http://passport.jd.com/loginservice.aspx?callback=?", loginMethod:"Login", loginUrl:"http://passport.en.jd.com/user/facade", returnUrl:location.href, automatic:true, complete:null, modal:false}, b || {});
    if (b.loginService != "" && b.loginMethod != "") {
        $.getJSON(b.loginService, {method:b.loginMethod}, function (a) {
            if (a != null) {
                if (b.complete != null) {
                    b.complete(a.Identity)
                }
                if (!a.Identity.IsAuthenticated && b.automatic && b.loginUrl != "") {
                    if (b.modal) {
                        jdModelCallCenter.login()
                    } else {
                        location.href = b.loginUrl + "?ReturnUrl=" + escape(b.returnUrl)
                    }
                }
            }
        })
    }
};
var jdFriendUrl = "http://club.jd.com/jdFriend/TuiJianService.aspx";
function FriendScript() {
    var c = getparam();
    if (c != "") {
        var d = document.createElement("script");
        d.type = "text/javascript";
        d.src = jdFriendUrl + "?roid=" + Math.random() + c;
        d.charset = "GB2312";
        document.getElementsByTagName("head")[0].appendChild(d)
    }
}
window.onload = function () {
    FriendScript()
};
function getparam() {
    var k = "";
    var o = "";
    var q = new Object();
    var m = location.search.substring(1);
    var n = m.split("&");
    for (var p = 0; p < n.length; p++) {
        var l = n[p].indexOf("=");
        if (l == -1) {
            continue
        }
        var j = n[p].substring(0, l);
        if (n[p].substring(0, l) == "sid") {
            k = unescape(n[p].substring(l + 1))
        }
        if (n[p].substring(0, l) == "t") {
            o = unescape(n[p].substring(l + 1))
        }
    }
    if (k != "" || o != "") {
        return"&sid=" + escape(k) + "&t=" + escape(o)
    } else {
        return""
    }
}
(function (b) {
    b.jdCalcul = function (h) {
        var a = null;
        var h = h.join(",");
        var k = "http://qiang.jd.com/HomePageLimitBuy.ashx?callback=?&ids=" + h;
        var l = "http://www.jd.com/product/";
        var j = function (g) {
            var c = b.extend({contentid:"#limit", clockid:"#clock", rankid:"#rank", limitid:"#limitbuy"}, g || {});
            if (g == {} || g == "" || c.start == null || c.start == "" || c.end == null || c.end == "") {
                return
            }
            c.start = m(c.start);
            c.start = (b.browser.mozzia) ? Date.parse(c.start) : c.start;
            c.server = m(c.server);
            c.server = (b.browser.mozzia) ? Date.parse(c.server) : c.server;
            c.end = m(c.end);
            c.end = (b.browser.mozzia) ? Date.parse(c.end) : c.end;
            c.contentid = b(c.contentid + c.qid);
            c.clockid = b(c.clockid + c.qid);
            c.rankid = b(c.rankid + c.qid);
            c.limitid = b(c.limitid + c.qid);
            var f = (c.start - c.server) / 1000, d, e, s, v;
            var t = (c.end - c.server) / 1000;
            var w = function () {
                var o = '<li><div class="p-img"><a href="{6}{0}.html" target="_blank"><img src="{1}" width="100" height="100" /></a>{2}</div><div class="p-name"><a href="{6}{0}.html" target="_blank">{3}</a></div><div class="p-price">\u951f\ufffd\u65a4\u62f7\u90cf\u951f\ufffdstrong>{4}</strong>{5}</div></li>';
                var n = "<ul>";
                b.each(c.pros, function (r) {
                    var q = c.pros[r].id, D = c.pros[r].tp, p = (c.pros[r].zt == 1) ? "<div class='pi9'></div>" : "<div class='pi10'></div>", E = unescape(c.pros[r].mc), C = c.pros[r].qg, B = "(" + c.pros[r].zk + "\u951f\u65a4\u62f7)";
                    n += o.replace(/\{0\}/g, q).replace("{1}", D).replace("{2}", p).replace("{3}", E).replace("{4}", C).replace("{5}", B).replace(/\{6\}/g, l)
                });
                n += "</ul>";
                c.contentid.html(n)
            };
            var u = function () {
                if (f > 0) {
                    return
                } else {
                    if (t > 0) {
                        d = Math.floor(t / 3600);
                        e = Math.floor((t - d * 3600) / 60);
                        s = (t - d * 3600) % 60;
                        c.clockid.html("\u5269\u951f\u65a4\u62f7<b>" + d + "</b>\u5c0f\u65f6<b>" + e + "</b>\u951f\u65a4\u62f7<b>" + s + "</b>\u951f\u65a4\u62f7");
                        t--
                    } else {
                        c.clockid.html("\u951f\ufffd\u65a4\u62f7\u951f\u65a4\u62f7\u951f\ufffd");
                        clearInterval(v);
                        c.limitid.hide();
                        if (c.rankid.length > 0) {
                            c.rankid.show()
                        }
                    }
                }
            };
            if (f <= 0 && t > 0) {
                w();
                if (c.rankid.length > 0) {
                    c.rankid.hide()
                }
                c.limitid.show()
            }
            u();
            v = setInterval(function () {
                u()
            }, 1000)
        };
        var m = function (d) {
            var e = d.split(" ");
            var f = e[0].split("-");
            var c = e[1].split(":");
            return new Date(f[0], f[1] - 1, f[2], c[0], c[1], c[2])
        };
        b.ajax({url:k, dataType:"jsonp", success:function (c) {
            if (c) {
                a = c.data;
                b.each(a, function (d) {
                    j(a[d])
                })
            }
        }})
    }
})(jQuery);
function mlazyload(l) {
    var m = {defObj:null, defHeight:0, fn:null};
    m = $.extend(m, l || {});
    var g = m.defHeight, j = (typeof m.defObj == "object") ? m.defObj : $(m.defObj);
    if (j.length < 1) {
        return
    }
    var h = function () {
        var b = document, a = (navigator.userAgent.toLowerCase().match(/iPad/i) == "ipad") ? window.pageYOffset : Math.max(b.documentElement.scrollTop, b.body.scrollTop);
        return b.documentElement.clientHeight + a - m.defHeight
    };
    var k = function () {
        if (j.offset().top <= h() && !j.attr("load")) {
            j.attr("load", "true");
            if (m.fn) {
                m.fn()
            }
        }
    };
    k();
    $(window).bind("scroll", function () {
        k()
    })
}
var jdRecent = {element:$("#recent ul"), jsurl:"http://www.jd.com/lishiset.aspx?callback=jdRecent.setData&id=", cookiename:"_recent", list:$.cookie("_recent"), url:location.href, init:function () {
    var d = this.url.match(/\/(\d{6}).html/);
    var c = (d != null && d[0].indexOf("html") != -1) ? d[1] : "";
    if (!this.list || this.list == null || this.list == "") {
        if (c == "") {
            return this.getData(0)
        } else {
            this.list = c
        }
    } else {
        if (c == "" || this.list.indexOf(c) != -1) {
            this.list = this.list
        } else {
            if (this.list.split(".").length >= 10) {
                this.list = this.list.replace(/.\d+$/, "")
            }
            this.list = c + "." + this.list
        }
    }
    $.cookie(this.cookiename, this.list, {expires:7, path:"/", domain:"jd.com", secure:false});
    this.getData(this.list)
}, clear:function () {
    $.cookie(this.cookiename, "", {expires:7, path:"/", domain:"jd.com", secure:false})
}, getData:function (d) {
    if (d == 0) {
        this.element.html("<li><div class='norecode'>\u951f\u65a4\u62f7\u951f\u776b\u7877\u62f7\u5f55!</div></li>");
        return
    }
    var c = d.split(".");
    for (i in c) {
        if (i == 0) {
            this.element.empty()
        }
        $.getJSONP(this.jsurl + c[i], this.setData)
    }
}, setData:function (b) {
    this.element.append("<li><div class='p-img'><a href='" + b.url + "'><img src='" + b.img + "' /></a></div><div class='p-name'><a href='" + b.url + "'>" + decodeURIComponent(b.name) + "</a></div></li>")
}};
$("#clearRec").click(function () {
    jdRecent.clear();
    jdRecent.getData(0)
});
mlazyload({defObj:"#recent", defHeight:50, fn:function () {
    if (jdRecent.element.length == 1) {
        jdRecent.init()
    }
}});
var jdModelCallCenter = {settings:{clstag1:0, clstag2:0}, tbClose:function () {
    if ($(".thickbox").length != 0) {
        jdThickBoxclose()
    }
}, login:function () {
    this.tbClose();
    var f = this;
    var d = navigator.userAgent.toLowerCase(), e = (d.match(/ucweb/i) == "ucweb" || d.match(/rv:1.2.3.4/i) == "rv:1.2.3.4");
    if (e) {
        location.href = "http://passport.en.jd.com/user/facade?ReturnUrl=" + escape("http://cart.en.jd.com/order/orderInfoMainEPT.html");
        return
    }
    setTimeout(function () {
        location.href = "http://passport.en.jd.com/user/facade?ReturnUrl=" + escape("http://cart.en.jd.com/order/orderInfoMainEPT.html");
        return
    }, 20)
}, login2:function () {
    this.tbClose();
    var f = this;
    var d = navigator.userAgent.toLowerCase(), e = (d.match(/ucweb/i) == "ucweb" || d.match(/rv:1.2.3.4/i) == "rv:1.2.3.4");
    if (e) {
        location.href = "http://passport.en.jd.com/user/facade?ReturnUrl=" + escape(location.href);
        return
    }
    setTimeout(function () {
        location.href = "http://passport.en.jd.com/user/facade?ReturnUrl=" + escape(location.href)
    }, 20)
}, regist:function () {
    this.tbClose();
    var b = this;
    setTimeout(function () {
        location.href = "http://passport.en.jd.com/user/facade?ReturnUrl=" + escape(location.href);
        return
    }, 20)
}, init:function () {
    var b = this;
    $.ajax({url:"http://passport.en.jd.com/user/hello?m=ls", dataType:"jsonp", success:function (a) {
        b.tbClose();
        if (a && a.info) {
            $("#loginbar").html(a.info)
        }
        b.settings.fn()
    }})
}};
$.extend(jdModelCallCenter, {autoLocation:function (d) {
    var c = this;
    $.login({modal:true, complete:function (a) {
        if (a != null && a.IsAuthenticated != null && a.IsAuthenticated) {
            window.location = d
        }
    }})
}});
$.extend(jdModelCallCenter, {doAttention:function (d) {
    var c = "http://t.jd.com/regard/follow.action?callback=?";
    $.login({modal:true, complete:function (a) {
        if (a != null && a.IsAuthenticated != null && a.IsAuthenticated) {
            if (d > 0) {
                $.getJSON(c, {goodId:d}, function (j) {
                    if (j.code != null) {
                        var b = 388, k = (j.code == "success") ? 300 : 100, h = (j.code == "success") ? false : 6;
                        $.jdThickBox({type:"iframe", source:"http://t.jd.com/subscriber/jumpSubPage.action?code=" + j.code + "&pid=" + d + "&t=" + Math.random(), width:b, height:k, title:"\u951f\u65a4\u62f7\u793a", _box:"attboxr", _con:"attconr", _countdown:h})
                    }
                })
            }
        }
    }})
}});
$(".btn-coll").livequery("click", function () {
    var c = $(this);
    var d = parseInt(c.attr("id").replace("coll", ""));
    $.extend(jdModelCallCenter.settings, {clstag1:"login|keycount|5|3", clstag2:"login|keycount|5|4", id:d, fn:function () {
        jdModelCallCenter.doAttention(this.id)
    }});
    jdModelCallCenter.settings.fn()
});
var category = {OBJ:$("#_JD_ALLSORT"), URL_Serv:"http://www.jd.com/ajaxservice.aspx?stype=SortJson", URL_BrandsServ:"http://www.jd.com/lishi.aspx?callback=category.getBrandService&id=a,915,925^b,916,926^c,917,927^d,918,928^e,919,929^f,920,930^g,921,931^h,922,932^i,923,933^j,924,934^k,2096,2097^l,3512,3513^m,5274,5275", FN_GetLink:function (h, g) {
    var f, e;
    switch (h) {
        case 1:
            f = g.u;
            e = g.n;
            break;
        case 2:
            f = g.split("|")[0];
            e = g.split("|")[1];
            break
    }
    if (f == "") {
        return e
    } else {
        if (!/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-.\/?%&=]*)?$/.test(f)) {
            f = "http://www.jd.com/products/" + f + ".html"
        }
        return'<a href="' + f + '">' + e + "</a>"
    }
}, FN_SetLink:function (d) {
    var c = "";
    return c
}, DATA_Simple:{"1":[
    {l:"http://book.jd.com/", n:"\u56fe\u951f\u65a4\u62f7"},
    {l:"http://e.jd.com/", n:"\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u4ecb\u520a"},
    {l:"http://mvd.jd.com/", n:"\u951f\u65a4\u62f7\u951f\u65a4\u62f7"}
], "2":[
    {l:"http://www.jd.com/electronic.html", n:"\u951f\u65a4\u62f7\u951f\u77eb\u7889\u62f7\u951f\u65a4\u62f7"}
], "3":[
    {l:"http://www.jd.com/digital.html", n:"\u951f\u8857\u4f19\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7"}
], "4":[
    {l:"http://www.jd.com/computer.html", n:"\u951f\u65a4\u62f7\u951f\u7686\u2605\u62f7\u951f\u5c4a\u516c"}
], "5":[
    {l:"http://www.jd.com/home.html", n:"\u951f\u63ed\u5c45\u7877\u62f7\u88c5"},
    {l:"http://www.jd.com/kitchenware.html", n:"\u951f\u65a4\u62f7\u951f\ufffd"}
], "6":[
    {l:"http://www.jd.com/clothing.html", n:"\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u978b\u5e3d"}
], "7":[
    {l:"http://www.jd.com/beauty.html", n:"\u951f\u65a4\u62f7\u951f\u9636\ufffd"}
], "8":[
    {l:"http://www.jd.com/bag.html", n:"\u951f\u65a4\u62f7\u54c1\u951f\u65a4\u62f7\u951f\ufffd"},
    {l:"http://www.jd.com/watch.html", n:"\u951f\u63a5\u618b\u62f7"},
    {l:"http://www.jd.com/jewellery.html", n:"\u951f\u4ecb\u5b9d"}
], "9":[
    {l:"http://www.jd.com/sports.html", n:"\u951f\u527f\u8bb9\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7"}
], "10":[
    {l:"http://www.jd.com/auto.html", n:"\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u54c1"}
], "11":[
    {l:"http://www.jd.com/baby.html", n:"\u6bcd\u5a74"},
    {l:"http://www.jd.com/toys.html", n:"\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\ufffd"}
], "12":[
    {l:"http://www.jd.com/food.html", n:"\u98df\u54c1\u951f\u65a4\u62f7\u951f\u8f83\u2605\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u98df\u54c1"}
], "13":[
    {l:"http://caipiao.jd.com/", n:"\u951f\u65a4\u62f7\u7968"},
    {l:"http://trip.jd.com/", n:"\u951f\u65a4\u62f7\u951f\u65a4\u62f7"},
    {l:"http://www.jd.com/recharge/", n:"\u951f\u65a4\u62f7\u503c"},
    {l:"http://www.jd.com/products/4938-4943-000.html", n:"\u7968\u951f\u65a4\u62f7"}
]}, TPL_Simple:'{for item in data}		<div class="item fore${parseInt(item_index)}">			<span><h3>			{for sItem in item}{if sItem_index!=0}\u951f\u65a4\u62f7{/if}<a href="${sItem.l}">${sItem.n}</a>{/for}			</h3><s></s></span>		</div>		{/for}<div class="extra"><a href="http://www.jd.com/allSort.aspx">\u5168\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u54c1\u951f\u65a4\u62f7\u951f\u65a4\u62f7</a></div>', FN_InitSimple:function () {
    var c, d = {};
    d.data = this.DATA_Simple;
    c = this.TPL_Simple.process(d);
    $("#_JD_ALLSORT").html(c)
}, TPL_Items:'{for item in data}		<div class="item fore${parseInt(item_index)+1}">			<span><h3>${item.n}</h3><s></s></span>			<div class="i-mc">				<div onclick="$(this).parent().parent().removeClass(\'hover\')" class="close"></div>				<div class="subitem">					{for subitem in item.i}					<dl class="fore${parseInt(subitem_index)+1}">						<dt>							${category.FN_GetLink(1,subitem)}						</dt>						<dd>{for link in subitem.i}<em>${category.FN_GetLink(2,link)}</em>{/for}</dd>					</dl>					{/for}				</div>				<div class="fr" id="JD_sort_${item.t}"><div class="loading-style1"><b></b>\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u53eb\uff4f\u62f7\u951f\u65a4\u62f7\u951f\u7686\u7334\u62f7...</div></div>			</div>		</div>		{/for}<div class="extra"><a href="http://www.jd.com/allSort.aspx">\u5168\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u54c1\u951f\u65a4\u62f7\u951f\u65a4\u62f7</a></div>', TPL_Brands:'${category.FN_SetLink(id)}		{if b.length!=0}		<dl class="categorys-brands">			{if id==\'k\'}				<dt>\u951f\u72e1\u7877\u62f7\u54c1\u951f\u72e1\u7b79\u62f7\u951f\u65a4\u62f7\u951f\ufffd/dt>			{else}				{if id==\'l\'}					<dt>\u951f\u72e1\u7877\u62f7\u951f\u72e1\ufffd/dt>				{else}					<dt>\u951f\u72e1\u7877\u62f7\u54c1\u951f\u65a4\u62f7</dt>				{/if}			{/if}			<dd>				<ul>					{for item in b}					<li><a href="${item.u}" target="_blank">${item.n}</a></li>					{/for}				</ul>			</dd>		</dl>		{/if}		{if p.length!=0}		<dl class="categorys-promotions">			<dt>\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u7583\ufffd/dt>			<dd>				<ul>					{for item in p}					<li><a href="${item.u}" target="_blank">${item.n}</a></li>					{/for}				</ul>			</dd>		</dl>		{/if}', FN_GetData:function () {
    $.getJSONP(this.URL_Serv, category.getDataService)
}, FN_GetBrands:function () {
    $.getJSONP(this.URL_BrandsServ, category.getBrandService)
}, getDataService:function (c) {
    var d = this.TPL_Items.process(c);
    this.OBJ.attr("load", "1").html(d);
    this.FN_GetBrands();
    this.OBJ.find(".item").Jdropdown({delay:200})
}, getBrandService:function (e) {
    var f = this, d = e.data;
    this.OBJ.attr("load", "2");
    $.each(d, function (a) {
        var b = f.TPL_Brands.process(d[a]);
        $("#JD_sort_" + d[a].id).html(b)
    })
}, FN_Init:function () {
    if (!this.OBJ.length) {
        return
    }
    if (!this.OBJ.attr("load")) {
        if (window.pageConfig && window.pageConfig.pageId != 0) {
            this.FN_InitSimple()
        }
        $("#categorys").Jdropdown({delay:200})
    }
    var b = this;
    this.OBJ.one("mouseover", function () {
        var a = b.OBJ.attr("load");
        if (!a) {
            b.FN_GetData()
        } else {
            if (a == 1) {
                b.FN_GetBrands()
            } else {
                return
            }
        }
    })
}};
var UC = {DATA_Cookie:"_recent", TPL_UnRegist:'<div class="prompt">			<span class="fl">\u951f\u65a4\u62f7\u832b\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u5f55</span>			<span class="fr"><a href="javascript:login()" class="btn-login" clstag="homepage|keycount|home2012|04a">\u951f\u65a4\u62f7\u5f55\u951f\u65a4\u62f7\u951f\u65a4\u62f7</a></span>		</div>', TPL_Regist:'<div class="prompt">				<span class="fl"><strong>${Name}</strong></span>				<span class="fr"><a href="http://home.jd.com/">\u53bb\u951f\u63ed\u7684\u6485\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u9875&nbsp;&gt;</a></span>			</div>', TPL_OList:{placeholder:'<div id="jduc-orderlist"></div>', fragment:'<div class="orderlist">				<div class="smt">					<h4>\u951f\u65a4\u62f7\u951f\u94f0\u8bb9\u62f7\u951f\u65a4\u62f7\u72b6\u6001\u951f\u65a4\u62f7</h4>					<div class="extra"><a href="http://jd2008.jd.com/JdHome/OrderList.aspx" target="_blank">\u951f\u4ecb\u770b\u951f\u65a4\u62f7\u951f\u53eb\u8bb9\u62f7\u951f\u65a4\u62f7&nbsp;&gt;</a></div>				</div>				<div class="smc">					<ul>						{for item in orderList}						<li class="fore${parseInt(item_index)+1}">							<div class="p-img fl">								{for image in item.OrderDetail}									{if image_index<2}										<a href="http://www.jd.com/product/${image.ProductId}.html" target="_blank"><img src="${pageConfig.FN_GetImageDomain(image.ProductId)}n5/${image.ImgUrl}" width="50" height="50" alt="${image.ProductName}" /></a>									{/if}								{/for}								{if item.OrderDetail.length>2}									<a href="${item.passKeyUrl}" target="_blank" class="more">\u951f\u65a4\u62f7\u951f\ufffd/a>								{/if}							</div>							<div class="p-detail fr">								\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u811a\uff4f\u62f7${item.OrderId}<br />								\u72b6\u951f\u65a4\u62f7\u6001\u951f\u65a4\u62f7<span>${UC.FN_SetState(item.OrderState)}</span><br />								\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7<a href="${item.passKeyUrl}">\u951f\u4ecb\u770b\u951f\u65a4\u62f7\u951f\u65a4\u62f7</a>							</div>						</li>						{/for}					</ul>				</div>			</div>'}, TPL_UList:'<div class="uclist">				<ul class="fore1 fl">					<li><a target="_blank" clstag="homepage|keycount|home2012|04b" href="http://jd2008.jd.com/JdHome/OrderList.aspx">\u951f\u65a4\u62f7\u951f\ufffd\u951f\u65a4\u62f7<span id="num-unfinishedorder"></span></a></li>					<li><a target="_blank" clstag="homepage|keycount|home2012|04c" href="http://jd2008.jd.com/user_spzx.aspx">\u951f\u65a4\u62f7\u8be2\u951f\u622a\u9769\u62f7<span id="num-consultation"></span></a></li>					<li><a target="_blank" clstag="homepage|keycount|home2012|04d" href="http://t.jd.com/home/follow?page=1&m_m=1&r_r=1">\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u54c1<span id="num-reduction"></span></a></li>					<li><a target="_blank" clstag="homepage|keycount|home2012|04e" href="http://coupon.jd.com/user_quan.aspx">\u951f\u811a\u4f19\u62f7\u5238<span id="num-ticket"></span></a></li>				</ul>				<ul class="fore2 fl">					<li><a target="_blank" clstag="homepage|keycount|home2012|04f" href="http://jd2008.jd.com/JdHome/OrderList.aspx">\u951f\u63ed\u7684\u8bb9\u62f7\u951f\u65a4\u62f7&nbsp;&gt;</a></li>					<li><a target="_blank" clstag="homepage|keycount|home2012|04g" href="http://bankws.jd.com/score/Integral/ScoreExhibit.aspx">\u951f\u63ed\u7684\u4f19\u62f7\u951f\ufffd&nbsp;&gt;</a></li>					<li><a target="_blank" clstag="homepage|keycount|home2012|04h" href="http://coupon.jd.com/user_quan.aspx">\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u5238&nbsp;&gt;</a></li>					<li><a target="_blank" clstag="homepage|keycount|home2012|04i" href="http://t.jd.com/home/follow">\u951f\u63ed\u7684\u7678\u62f7\u6ce8&nbsp;&gt;</a></li>				</ul>			</div>', TPL_VList:{placeholder:'<div class="viewlist" clstag="homepage|keycount|home2012|04j">				<div class="smt">					<h4>\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\ufffd\u65a4\u62f7\u951f\u72e1\u51e4\u62f7\u951f\ufffd/h4>				</div>				<div class="smc" id="jduc-viewlist">					<div class="loading-style1"><b></b>\u951f\u65a4\u62f7\u951f\u65a4\u62f7\u951f\u53eb\uff4f\u62f7\u951f\u65a4\u62f7\u951f\u7686\u7334\u62f7...</div>					<ul class="lh hide"></ul>				</div>			</div>', fragment:'<li><a href="${url}" target="_blank" title="${decodeURIComponent(name)}"><img src="${img}" width="50" height="50" alt="${decodeURIComponent(name)}" /></a></li>'}, FN_SetState:function (b) {
    var b = b;
    if (b.length > 4) {
        b = "<span title=" + b + ">" + b.substr(0, 4) + "...</span>"
    }
    return b
}, FN_InitVList:function (d) {
    var c = d.split(".");
    $.each(c, function (a) {
        if (a >= 5) {
            return
        }
        $.getJSONP("http://www.jd.com/lishiset.aspx?callback=UC.FN_ShowVList&id=" + c[a], UC.FN_ShowVList)
    })
}, FN_ShowVList:function (d) {
    var f = $("#jduc-viewlist").find(".loading-style1");
    if (f.length > 0) {
        f.hide()
    }
    var e = this.TPL_VList.fragment.process(d);
    $("#jduc-viewlist").find("ul").eq(0).append(e).show()
}, FN_setWords:function (d) {
    var f = '<font style="color:{0}">({1})</font>', e = "";
    if (d == 0) {
        e = "#ccc"
    } else {
        e = "#c00"
    }
    return pageConfig.FN_StringFormat(f, e, d)
}, FN_InitOList:function () {
    $.ajax({url:"http://minijd.jd.com/getOrderList", dataType:"jsonp", success:function (c) {
        if (c && c.error == 0 && c.orderList) {
            var d = UC.TPL_OList.fragment.process(c);
            $("#jduc-orderlist").html(d)
        }
    }});
    $.ajax({url:"http://minijd.jd.com/getHomeCount", dataType:"jsonp", success:function (b) {
        if (b && b.error == 0) {
            $("#num-unfinishedorder").html(UC.FN_setWords(b.orderCount))
        }
    }});
    $.ajax({url:"http://comm.jd.com/index.php?mod=Consultation&action=havingReplyCount", dataType:"jsonp", success:function (b) {
        if (b) {
            $("#num-consultation").html(UC.FN_setWords(b.cnt))
        }
    }});
    $.ajax({url:"http://t.jd.com/follow/followProductCount.action", data:{method:"GetCount"}, dataType:"jsonp", success:function (b) {
        if (b) {
            $("#num-reduction").html(UC.FN_setWords(b.priceReduction))
        }
    }});
    $.ajax({url:"http://coupon.jd.com/service.ashx", data:{m:"getcouponcount"}, dataType:"jsonp", success:function (b) {
        if (b) {
            $("#num-ticket").html(UC.FN_setWords(b.CouponCount))
        }
    }})
}};

var $o = (function (A) {
    var C = {};
    C.replace = function (b, a) {
        return b.replace(/#{(.*?)}/g, function () {
            var c = arguments[1];
            if ("undefined" != typeof(a[c])) {
                return a[c]
            } else {
                return arguments[0]
            }
        })
    };
    String.prototype.trim = function () {
        return this.replace(/^\s*(.*?)\s*$/, "$1")
    };
    String.prototype.isEmpty = function () {
        if (0 == this.length) {
            return true
        } else {
            return false
        }
    };
    var v = '<a id="d_#{id}" href="javascript:void(0);" title="#{title}" onclick="$o.clickItem(this)" cid="#{cid}" cLevel="#{cLevel}" ev_val="#{ev_val}" onmouseover="$o.mouseOverEvItem(event, this);" onmouseout="$o.mouseOutEvItem(event, this);">#{ev_name}</a>';
    var E = '<a href="javascript:void(0);" title="#{title}" onclick="$o.clickItem(this)" cid="#{cid}" cLevel="#{cLevel}" onmouseover="$o.mouseOverEvItem(event, this)" onmouseout="$o.mouseOutEvItem(event, this);">\u66F4\u591A&gt;&gt;</a>';
    var B = '<div id="d_#{id}" class="item3" cid="#{cid}" cLevel="#{cLevel}" onmouseover="$o.mouseOverItem(this)" onmouseout="$o.mouseOutItem(this)"><span>\u6309#{es_name}\u951f\u65a4\u62f7</span>#{evs}</div>';
    var z = '<li id="d_#{id}" title="#{title}" onclick="$o.clickItem(this)" onmouseover="$o.mouseOverItem(this)" onmouseout="$o.mouseOutItem(this)"><div>#{keyword}</div></li>';
    var F = '<div id="d_#{id}" class="#{className}" title="#{title}" cid="#{cid}" cLevel="#{cLevel}" onclick="$o.clickItem(this)" onmouseover="$o.mouseOverItem(this)" onmouseout="$o.mouseOutItem(this)">\u5728<strong>#{cname}</strong>\u5206\u7c7b\u4e2d\u641c\u7d22</div>';
    var x = '<li class="fore1"><div id="d_#{id}" class="fore1" title="#{title}" onclick="$o.clickItem(this)" onmouseover="$o.mouseOverItem(this)" onmouseout="$o.mouseOutItem(this)">#{keyword}</div>#{categorys}</li>';
    var u = "dd.search.jd.com";
    var s = "http://" + u + "/?key=#{keyword}&callback=$o.onloadItems";
    var t = "#FFDFC6";
    var D = "#FFF";
    var w = $("#key");
    var r = $("#shelper");

    function G() {
        this.length = 0;
        this.index = -1;
        this.HIndex = -1;
        this.needCreatedItem = false
    }

    G.prototype.init = function () {
        this.length = 0;
        this.index = -1;
        this.HIndex = -1;
        this.needCreatedItem = false
    };
    G.prototype.hideTip = function () {
        this.init();
        r.html("").hide()
    };
    G.prototype.clickItem = function (b) {
        var c = b.getAttribute("cid");
        if (null != c && "" != c) {
            search.cid = c
        } else {
            search.cid = null
        }
        var e = b.getAttribute("cLevel");
        if (null != e && "" != e) {
            search.cLevel = e
        } else {
            search.cLevel = null
        }
        var a = b.getAttribute("ev_val");
        if (null != a && !a.trim().isEmpty()) {
            search.ev_val = a
        } else {
            search.ev_val = null
        }
        var d = b.getAttribute("title");
        if (null != d && !d.trim().isEmpty()) {
            w.val(d)
        }
        search("key")
    };
    G.prototype.mouseOverItem = function (b) {
        if (null == b) {
            return
        }
        b.style.backgroundColor = t;
        if (-1 != this.index && null != b.id && !b.id.trim().isEmpty()) {
            var a = b.id.split("_");
            if (2 == a.length) {
                var c = parseInt(a[1], 10);
                if (c != this.index) {
                    $("#d_" + this.index).css("background-color", D);
                    this.index = c
                }
                if (-1 != this.HIndex) {
                    $("#d_" + this.index + "_" + this.HIndex).css("text-decoration", "none");
                    this.HIndex = -1
                }
            }
        }
        this.needCreatedItem = true
    };
    G.prototype.mouseOutItem = function (a) {
        if (null != a) {
            a.style.backgroundColor = D
        }
        this.needCreatedItem = false
    };
    G.prototype.mouseOverEvItem = function (b, a) {
        if ("function" == typeof(b.stopPropagation)) {
            b.stopPropagation()
        } else {
            b.cancelBubble = true
        }
        var d = parseInt(a.parentNode.id.split("_")[1]);
        this.index = d;
        var c = parseInt(a.id.split("_")[2], 10);
        this.HIndex = c;
        a.parentNode.style.backgroundColor = t;
        a.style.textDecoration = "underline";
        this.needCreatedItem = true
    };
    G.prototype.mouseOutEvItem = function (b, a) {
        if ("function" == typeof(b.stopPropagation)) {
            b.stopPropagation()
        } else {
            b.cancelBubble = true
        }
        a.parentNode.style.backgroundColor = D;
        a.style.textDecoration = "none"
    };
    G.prototype.moveUp = function () {
        var a = this;
        if (a.length > 0) {
            a.index -= 1;
            if (a.index < 0) {
                a.index = a.length - 1
            }
            var b = a.index;
            var c = (b == a.length - 1 ? 0 : b + 1);
            a.selectItemNode(b, c)
        }
    };
    G.prototype.moveDown = function () {
        var b = this;
        if (b.length > 0) {
            b.index = ($o.index + 1) % $o.length;
            var c = b.index;
            var a = (0 === c ? $o.length - 1 : c - 1);
            b.selectItemNode(c, a)
        }
    };
    G.prototype.selectItemNode = function (j, b) {
        var h = this;
        var c = $("#d_" + j);
        var f = $("#d_" + b);
        if (c.length > 0 && f.length > 0) {
            c.css("background-color", t);
            if (j != b) {
                f.css("background-color", D)
            }
            var d = c.attr("title");
            if (null != d && !d.trim().isEmpty()) {
                w.val(d)
            }
            var g = c.attr("cid");
            if (null != g && "" != g) {
                search.cid = g
            } else {
                search.cid = null
            }
            var e = c.attr("cLevel");
            if (null != e && "" != e) {
                search.cLevel = e
            } else {
                search.cLevel = null
            }
            search.ev_val = null;
            if (-1 != h.HIndex) {
                var k = $("#d_" + b + "_" + h.HIndex);
                if (k.length > 0) {
                    k.css("text-decoration", "none");
                    h.HIndex = -1
                }
            }
            var a = c.attr("class");
            if (-1 == h.HIndex && a == "item3") {
                h.moveRight()
            }
        }
    };
    G.prototype.moveLeft = function (a) {
        var f = this;
        var b = $("#d_" + f.index);
        var l = b.attr("class");
        if (null != l && "item3" == l) {
            var d = b.attr("ev_amount");
            var e = parseInt(d, 10);
            f.HIndex -= 1;
            if (f.HIndex < 0) {
                f.HIndex = e - 1
            }
            var h = f.HIndex;
            var c = "#d_" + f.index + "_" + f.HIndex;
            var j = $(c);
            var m = (h == e - 1 ? 0 : h + 1);
            var g = "#d_" + f.index + "_" + m;
            var k = $(g);
            f.selectHorizontalItemNode(j, k)
        }
    };
    G.prototype.moveRight = function (a) {
        var e = this;
        var b = $("#d_" + e.index);
        var j = b.attr("class");
        if (null != j && "item3" == j) {
            var c = b.attr("ev_amount");
            var d = parseInt(c, 10);
            e.HIndex = (e.HIndex + 1) % d;
            var f = e.HIndex;
            var k = (0 == f ? d - 1 : f - 1);
            var g = $("#d_" + e.index + "_" + f);
            var h = $("#d_" + e.index + "_" + k);
            e.selectHorizontalItemNode(g, h)
        }
    };
    G.prototype.selectHorizontalItemNode = function (b, a) {
        b.css("text-decoration", "underline");
        if (b.attr("id") != a.attr("id")) {
            a.css("text-decoration", "none")
        }
        var c = b.attr("ev_val");
        if (null != c && !c.trim().isEmpty()) {
            search.ev_val = c
        } else {
            search.ev_val = null
        }
    };
    G.prototype.keyup = function (c) {
        var d = this;
        var e = c;
        if (null != window.event && "object" == typeof(window.event)) {
            e = window.event
        }
        if (0 == w.length) {
            w = $("#key")
        }
        if (0 == r.length) {
            r = $("tie")
        }
        var f = w.val().trim();
        if ("" == f) {
            r.html("").hide();
            return
        }
        var a = e.keyCode;
        switch (a) {
            case 37:
                d.moveLeft(e);
                break;
            case 38:
                d.moveUp(e);
                break;
            case 39:
                d.moveRight(e);
                break;
            case 40:
                d.moveDown();
                break;
            case 27:
                d.hideTip();
                break;
            default:
                f = encodeURIComponent(f);
                var b = C.replace(s, {keyword:f});
                $.ajax({url:b, dataType:"jsonp", scriptCharset:"utf-8", jsonp:"jsonp_callback"});
                break
        }
    };
    G.prototype.onloadItems = function (ax) {
        var f = w.val().trim();
        if ("" == f) {
            r.html("").hide();
            return
        }
        var aS = ax.length;
        if (0 == aS) {
            this.hideTip();
            return
        }
        var aP = this;
        aP.init();
        var c = "";
        var aY = "";
        var aQ = "";
        var l = 0;
        if ("undefined" != typeof(window.pageConfig) && "undefined" != typeof(window.pageConfig.searchType)) {
            l = window.pageConfig.searchType
        }
        var g = /^[1-8]4$/;
        var aE = false;
        var e = false;
        var bc = 0;
        var aM = 0;
        for (var j = 0, k = 0, ay = aS; j < ay; j++) {
            var a9 = ax[j];
            var a6 = w.val().trim();
            var aw = new RegExp("^(" + a6 + ")");
            var au = a9.keyword.trim();
            var aR = au.search(aw);
            var p = au;
            if (aR > -1) {
                var a5 = au.replace(aw, "");
                p = a6 + "<strong>" + a5 + "</strong>"
            }
            if ("string" == typeof(a9.cid) && !a9.cid.trim().isEmpty()) {
                if ("" == aY) {
                    aY = C.replace(x, {id:k, title:a9.keyword, keyword:p});
                    k += 1
                }
                if ("string" == typeof(a9.cname) && a9.cname.trim().isEmpty()) {
                    aS -= 1;
                    continue
                }
                var aO = a9.level;
                if (null == aO || "undefined" == typeof(aO)) {
                    aS -= 1;
                    continue
                }
                if (0 == l) {
                    e = true;
                    if ("string" == typeof(aO) && g.test(aO)) {
                        aS -= 1;
                        continue
                    }
                } else {
                    if (5 == l) {
                        if ("string" == typeof(aO) && !(/^[5-8]2$/.test(aO))) {
                            aS -= 1;
                            continue
                        }
                    } else {
                        if (1 == l || 2 == l || 3 == l || 4 == l) {
                            aS -= 1;
                            continue
                        }
                    }
                }
                var aI = "";
                if ("3" == aO && null != a9.expand && (a9.expand instanceof Array) && a9.expand.length > 0) {
                    aE = true
                } else {
                    aE = false
                }
                var aU = "";
                if (aE) {
                    aU = "item2"
                } else {
                    aU = "item1"
                }
                var aJ = C.replace(F, {id:k, title:a9.keyword, cid:a9.cid, cLevel:a9.level, className:aU, cname:a9.cname});
                var n = "";
                if (aE) {
                    var aK = a9.expand;
                    bc = a9.expand.length;
                    loopEs:for (var m = 0; m < bc; m++) {
                        var av = a9.expand[m];
                        var a3 = av.esname;
                        if (null == a3 || "undefined" == typeof(a3) || "" == a3) {
                            continue loopEs
                        }
                        var aW = av.esid;
                        if (null == aW || "undefined" == typeof(aW) || "" == aW) {
                            continue loopEs
                        }
                        k += 1;
                        if (0 == aM) {
                            aM = k
                        }
                        var a2 = av.evs;
                        var at = 0;
                        var ba = false;
                        if (null != a2 && (a2 instanceof Array) && a2.length > 0) {
                            ba = true;
                            at = a2.length
                        } else {
                            ba = false
                        }
                        var h = C.replace(B, {id:k, cid:a9.cid, cLevel:a9.level, es_name:a3});
                        if (ba) {
                            sEvTmp = "";
                            loopEv:for (var aD = 0; aD < at; aD++) {
                                var aC = a2[aD];
                                var aG = aC.evname;
                                var aF = aC.evid;
                                if (null == aG || "" == aG) {
                                    continue loopEv
                                }
                                if (null == aF || "" == aF) {
                                    continue loopEv
                                }
                                var aV = encodeURIComponent(a3) + "_" + encodeURIComponent(aG);
                                if ("\u4EF7\u683C" == a3) {
                                    var b = "";
                                    if (aG.search(/(\d*).*\u4E0B/) > -1) {
                                        b = "0-" + RegExp.$1
                                    } else {
                                        if (aG.search(/(\d*).*\u4E0A/) > -1) {
                                            b = RegExp.$1 + "gt"
                                        } else {
                                            b = aG.replace(/\u951f\u65a4\u62f7/g, "-")
                                        }
                                    }
                                    aV = "exprice_" + b
                                }
                                if ("\u54C1\u724C" == a3) {
                                    aV = "exbrand_" + encodeURIComponent(aG)
                                }
                                var az = k + "_" + aD;
                                sEvTmp += C.replace(v, {id:az, title:a9.keyword, ev_name:aG, ev_val:aV, cid:a9.cid, cLevel:a9.level})
                            }
                            sEvTmp += C.replace(E, {title:a9.keyword, cid:a9.cid, cLevel:a9.level});
                            h = C.replace(h, {evs:sEvTmp})
                        }
                        n += h
                    }
                }
                aJ += n;
                aQ += aJ
            } else {
                var aJ = C.replace(z, {id:k, title:a9.keyword, keyword:p});
                c += aJ
            }
            k += 1
        }
        if ("" != aY) {
            aY = C.replace(aY, {categorys:aQ});
            c = aY + c;
            aP.length = aS + 1
        } else {
            aP.length = aS
        }
        aP.length += bc;
        if ("" != c) {
            c += '<li class="close" onclick="$o.hideTip()">\u5173\u95ed</li>';
            r.html(c).show();
            var aN = $("ul#shelper .item3");
            var a1 = aN.length;
            if (a1 <= 3) {
                for (var j = 0; j < a1; j++) {
                    var q = aN[j];
                    var a0 = $(q);
                    var aZ = a0.children("a");
                    var aL = a0.offset().top;
                    var a = a0.height();
                    var aX = aL + a / 2;
                    var aH = aZ.length - 1;
                    var a7 = null;
                    var a8 = null;
                    evLoop:for (var k = aH; k >= 0; k--) {
                        var bb = aZ[k];
                        if (null == a7) {
                            a7 = bb.parentNode
                        }
                        var aT = $(bb);
                        if (k == aH) {
                            a8 = aT
                        }
                        var d = aT.offset().top;
                        if (k < aH && d > aX) {
                            var a4 = bb;
                            a7.removeChild(a4)
                        } else {
                            continue evLoop
                        }
                    }
                    if (null != a8 && null != a7) {
                        var bd = a7.children.length;
                        if (a8.offset().top > aX && bd >= 2) {
                            a7.removeChild(a7.children[bd - 2]);
                            bd -= 1
                        }
                        var o = "d_" + (aM + j) + "_" + (bd - 2);
                        a7.lastChild.setAttribute("id", o);
                        a7.setAttribute("ev_amount", bd - 1)
                    }
                }
            }
        } else {
            r.html("").hide()
        }
    };
    var y = new G();
    w.keyup(function (a) {
        y.keyup(a)
    });
    w.blur(function () {
        if (!y.needCreatedItem) {
            y.hideTip()
        }
    });
    return y
})();

